1 //===- Utils.cpp - llvm-reduce utility functions --------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file contains some utility functions supporting llvm-reduce. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "Utils.h" 14 #include "llvm/IR/Constants.h" 15 16 using namespace llvm; 17 getDefaultValue(Type * T)18Value *llvm::getDefaultValue(Type *T) { 19 return T->isVoidTy() ? PoisonValue::get(T) : Constant::getNullValue(T); 20 } 21