LLVM API Documentation
#include "LLVMContextImpl.h"#include "llvm/Constants.h"#include "ConstantFold.h"#include "llvm/DerivedTypes.h"#include "llvm/GlobalValue.h"#include "llvm/Instructions.h"#include "llvm/Module.h"#include "llvm/Operator.h"#include "llvm/ADT/FoldingSet.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/StringMap.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/ManagedStatic.h"#include "llvm/Support/MathExtras.h"#include "llvm/System/Mutex.h"#include "llvm/System/RWMutex.h"#include "llvm/System/Threading.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallVector.h"#include <algorithm>#include <map>
Go to the source code of this file.
Namespaces | |
| namespace | llvm |
Functions | |
| static const fltSemantics * | TypeToFloatSemantics (const Type *Ty) |
| static char | getValType (ConstantAggregateZero *CPZ) |
| static char | getValType (ConstantPointerNull *) |
| static char | getValType (UndefValue *) |
| static ExprMapKeyType | getValType (ConstantExpr *CE) |
| static Constant * | getFoldedCast (Instruction::CastOps opc, Constant *C, const Type *Ty) |
| static std::vector< Constant * > | getValType (ConstantArray *CA) |
| static std::vector< Constant * > | getValType (ConstantStruct *CS) |
| static std::vector< Constant * > | getValType (ConstantVector *CP) |
Variables | |
| static const uint64_t | zero [2] = {0, 0} |
| static Constant* getFoldedCast | ( | Instruction::CastOps | opc, | |
| Constant * | C, | |||
| const Type * | Ty | |||
| ) | [inline, static] |
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 1040 of file Constants.cpp.
References llvm::ConstantFoldCastInstruction(), llvm::LLVMContextImpl::ExprConstants, llvm::Type::getContext(), llvm::Type::isFirstClassType(), and llvm::LLVMContext::pImpl.
Referenced by 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().
| static std::vector<Constant*> getValType | ( | ConstantVector * | CP | ) | [static] |
Definition at line 1991 of file Constants.cpp.
References llvm::User::getNumOperands(), and llvm::Constant::getOperand().
| static std::vector<Constant*> getValType | ( | ConstantStruct * | CS | ) | [static] |
Definition at line 1915 of file Constants.cpp.
References llvm::User::getNumOperands(), and llvm::Constant::getOperand().
| static std::vector<Constant*> getValType | ( | ConstantArray * | CA | ) | [static] |
replaceUsesOfWithOnConstant - Update this constant array to change uses of 'From' to be uses of 'To'. This must update the uniquing data structures etc.
Note that we intentionally replace all uses of From with To here. Consider a large array that uses 'From' 1000 times. By handling this case all here, ConstantArray::replaceUsesOfWithOnConstant is only invoked once, and that single invocation handles all 1000 uses. Handling them one at a time would work, but would be really slow because it would have to unique each updated array instance.
Definition at line 1820 of file Constants.cpp.
References llvm::User::getNumOperands(), and llvm::Constant::getOperand().
| static ExprMapKeyType getValType | ( | ConstantExpr * | CE | ) | [static] |
| static char getValType | ( | UndefValue * | ) | [static] |
Definition at line 1007 of file Constants.cpp.
| static char getValType | ( | ConstantPointerNull * | ) | [static] |
Definition at line 985 of file Constants.cpp.
| static char getValType | ( | ConstantAggregateZero * | CPZ | ) | [static] |
Definition at line 855 of file Constants.cpp.
| static const fltSemantics* TypeToFloatSemantics | ( | const Type * | Ty | ) | [static] |
Definition at line 326 of file Constants.cpp.
References llvm::Type::getContext(), llvm::Type::getDoubleTy(), llvm::Type::getFloatTy(), llvm::Type::getFP128Ty(), llvm::Type::getPPC_FP128Ty(), llvm::Type::getX86_FP80Ty(), llvm::APFloat::IEEEdouble, llvm::APFloat::IEEEquad, llvm::APFloat::IEEEsingle, llvm::APFloat::PPCDoubleDouble, and llvm::APFloat::x87DoubleExtended.
Referenced by llvm::ConstantFP::ConstantFP(), and llvm::ConstantFP::get().
const uint64_t zero[2] = {0, 0} [static] |
Definition at line 44 of file Constants.cpp.
Referenced by llvm::ConstantFoldCastInstruction(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateGlobalStringPtr(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), and llvm::Constant::getNullValue().