LLVM API Documentation
#include "llvm/IR/Constants.h"
#include "ConstantFold.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cstdarg>
Go to the source code of this file.
Functions | |
static bool | canTrapImpl (const Constant *C, SmallPtrSet< const ConstantExpr *, 4 > &NonTrappingOps) |
static bool | removeDeadUsersOfConstant (const Constant *C) |
static const fltSemantics * | TypeToFloatSemantics (Type *Ty) |
template<typename ItTy , typename EltTy > | |
static bool | rangeOnlyContains (ItTy Start, ItTy End, EltTy Elt) |
static Constant * | getFoldedCast (Instruction::CastOps opc, Constant *C, Type *Ty) |
static bool | isAllZeros (StringRef Arr) |
isAllZeros - return true if the array is empty or all zeros. More... | |
|
static |
Definition at line 240 of file Constants.cpp.
References llvm::CallingConv::C, llvm::dyn_cast(), llvm::User::getNumOperands(), llvm::Value::getType(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), and llvm::Type::isFirstClassType().
Referenced by llvm::Constant::canTrap().
|
inlinestatic |
This is a utility function to handle folding of casts and lookup of the cast in the ExprConstants map. It is used by the various get* methods below.
Definition at line 1429 of file Constants.cpp.
References llvm::ConstantFoldCastInstruction(), llvm::LLVMContextImpl::ExprConstants, R600_InstFlag::FC, llvm::Type::getContext(), llvm::Type::isFirstClassType(), and llvm::LLVMContext::pImpl.
Referenced by llvm::ConstantExpr::getAddrSpaceCast(), llvm::ConstantExpr::getBitCast(), llvm::ConstantExpr::getFPExtend(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getFPTrunc(), llvm::ConstantExpr::getIntToPtr(), llvm::ConstantExpr::getPtrToInt(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSIToFP(), llvm::ConstantExpr::getTrunc(), llvm::ConstantExpr::getUIToFP(), and llvm::ConstantExpr::getZExt().
isAllZeros - return true if the array is empty or all zeros.
Definition at line 2237 of file Constants.cpp.
References llvm::StringRef::begin(), llvm::StringRef::end(), and I.
Referenced by llvm::ConstantDataSequential::getImpl(), and llvm::ConstantStruct::replaceUsesOfWithOnConstant().
|
static |
Definition at line 726 of file Constants.cpp.
Referenced by llvm::ConstantArray::get().
removeDeadUsersOfConstant - If the specified constantexpr is dead, remove it. This involves recursively eliminating any dead users of the constantexpr.
Definition at line 376 of file Constants.cpp.
References llvm::CallingConv::C, llvm::dyn_cast(), llvm::Value::use_back(), and llvm::Value::use_empty().
Referenced by llvm::Constant::removeDeadConstantUsers().
|
static |
Definition at line 536 of file Constants.cpp.
References llvm::APFloat::IEEEdouble, llvm::APFloat::IEEEhalf, llvm::APFloat::IEEEquad, llvm::APFloat::IEEEsingle, llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isFP128Ty(), llvm::Type::isHalfTy(), llvm::Type::isPPC_FP128Ty(), llvm::Type::isX86_FP80Ty(), llvm::APFloat::PPCDoubleDouble, and llvm::APFloat::x87DoubleExtended.
Referenced by llvm::ConstantFP::ConstantFP(), llvm::ConstantFP::get(), and llvm::ConstantFP::getInfinity().