LLVM: lib/Transforms/Utils/Evaluator.cpp File Reference (original) (raw)
#include "[llvm/Transforms/Utils/Evaluator.h](Evaluator%5F8h%5Fsource.html)"#include "[llvm/ADT/DenseMap.h](DenseMap%5F8h%5Fsource.html)"#include "[llvm/ADT/STLExtras.h](STLExtras%5F8h%5Fsource.html)"#include "[llvm/ADT/SmallPtrSet.h](SmallPtrSet%5F8h%5Fsource.html)"#include "[llvm/ADT/SmallVector.h](SmallVector%5F8h%5Fsource.html)"#include "[llvm/Analysis/ConstantFolding.h](ConstantFolding%5F8h%5Fsource.html)"#include "[llvm/IR/BasicBlock.h](IR%5F2BasicBlock%5F8h%5Fsource.html)"#include "[llvm/IR/Constant.h](IR%5F2Constant%5F8h%5Fsource.html)"#include "[llvm/IR/Constants.h](Constants%5F8h%5Fsource.html)"#include "[llvm/IR/DataLayout.h](DataLayout%5F8h%5Fsource.html)"#include "[llvm/IR/DerivedTypes.h](DerivedTypes%5F8h%5Fsource.html)"#include "[llvm/IR/Function.h](IR%5F2Function%5F8h%5Fsource.html)"#include "[llvm/IR/GlobalAlias.h](GlobalAlias%5F8h%5Fsource.html)"#include "[llvm/IR/GlobalValue.h](GlobalValue%5F8h%5Fsource.html)"#include "[llvm/IR/GlobalVariable.h](GlobalVariable%5F8h%5Fsource.html)"#include "[llvm/IR/InstrTypes.h](InstrTypes%5F8h%5Fsource.html)"#include "[llvm/IR/Instruction.h](IR%5F2Instruction%5F8h%5Fsource.html)"#include "[llvm/IR/Instructions.h](Instructions%5F8h%5Fsource.html)"#include "[llvm/IR/IntrinsicInst.h](IR%5F2IntrinsicInst%5F8h%5Fsource.html)"#include "[llvm/IR/Type.h](IR%5F2Type%5F8h%5Fsource.html)"#include "[llvm/IR/User.h](IR%5F2User%5F8h%5Fsource.html)"#include "[llvm/IR/Value.h](IR%5F2Value%5F8h%5Fsource.html)"#include "[llvm/Support/Casting.h](Casting%5F8h%5Fsource.html)"#include "[llvm/Support/Debug.h](Support%5F2Debug%5F8h%5Fsource.html)"#include "[llvm/Support/raw_ostream.h](raw%5F%5Fostream%5F8h%5Fsource.html)"
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "evaluator" |
| Functions | |
|---|---|
| static bool | isSimpleEnoughValueToCommit (Constant *C, SmallPtrSetImpl< Constant * > &SimpleConstants, const DataLayout &DL) |
| static bool | isSimpleEnoughValueToCommitHelper (Constant *C, SmallPtrSetImpl< Constant * > &SimpleConstants, const DataLayout &DL) |
| Return true if the specified constant can be handled by the code generator. | |
| static Function * | getFunction (Constant *C) |
Macro Definition Documentation
◆ DEBUG_TYPE
#define DEBUG_TYPE "evaluator"
Definition at line 39 of file Evaluator.cpp.
Function Documentation
◆ getFunction()
| Function * getFunction ( Constant * C) | static |
|---|
Definition at line 237 of file Evaluator.cpp.
References llvm::CallingConv::C, and llvm::dyn_cast().
◆ isSimpleEnoughValueToCommit()
| bool isSimpleEnoughValueToCommit ( Constant * C, SmallPtrSetImpl< Constant * > & SimpleConstants, const DataLayout & DL ) | inlinestatic |
|---|
Definition at line 114 of file Evaluator.cpp.
References llvm::CallingConv::C, DL, llvm::SmallPtrSetImpl< PtrType >::insert(), and isSimpleEnoughValueToCommitHelper().
Referenced by isSimpleEnoughValueToCommitHelper().
◆ isSimpleEnoughValueToCommitHelper()
| bool isSimpleEnoughValueToCommitHelper ( Constant * C, SmallPtrSetImpl< Constant * > & SimpleConstants, const DataLayout & DL ) | static |
|---|
Return true if the specified constant can be handled by the code generator.
We don't want to generate something like: void *X = &X/42; because the code generator doesn't have a relocation that can handle that.
This function should be called if C was not found (but just got inserted) in SimpleConstants to avoid having to rescan the same constants all the time.
Definition at line 57 of file Evaluator.cpp.
References llvm::CallingConv::C, llvm::cast(), DL, llvm::dyn_cast(), llvm::isa(), and isSimpleEnoughValueToCommit().
Referenced by isSimpleEnoughValueToCommit().