diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-16 18:04:31 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-16 18:04:31 +0000 |
commit | 001dbfebcbbded8c8e74b19e838b50da2b6c6fb5 (patch) | |
tree | 1dc61249ea3e7ecc74b897c4c6014f9bbbc341ac /include | |
parent | f96db468fcf62d671cda99b68b6cfd3f2dc0b839 (diff) | |
download | external_llvm-001dbfebcbbded8c8e74b19e838b50da2b6c6fb5.zip external_llvm-001dbfebcbbded8c8e74b19e838b50da2b6c6fb5.tar.gz external_llvm-001dbfebcbbded8c8e74b19e838b50da2b6c6fb5.tar.bz2 |
Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/LoopPass.h | 1 | ||||
-rw-r--r-- | include/llvm/CallGraphSCCPass.h | 2 | ||||
-rw-r--r-- | include/llvm/Constants.h | 5 | ||||
-rw-r--r-- | include/llvm/LLVMContext.h | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h index 7659b5b..a6a23c6 100644 --- a/include/llvm/Analysis/LoopPass.h +++ b/include/llvm/Analysis/LoopPass.h @@ -37,6 +37,7 @@ public: // Initialization and finalization hooks. virtual bool doInitialization(Loop *L, LPPassManager &LPM) { + Context = L->getHeader()->getContext(); return false; } diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h index d5ff17c..8d5d7c3 100644 --- a/include/llvm/CallGraphSCCPass.h +++ b/include/llvm/CallGraphSCCPass.h @@ -22,6 +22,7 @@ #define LLVM_CALL_GRAPH_SCC_PASS_H #include "llvm/Pass.h" +#include "llvm/Analysis/CallGraph.h" namespace llvm { @@ -37,6 +38,7 @@ struct CallGraphSCCPass : public Pass { /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. virtual bool doInitialization(CallGraph &CG) { + Context = &CG.getModule().getContext(); return false; } diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index e06ce1f..df08641 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -50,6 +50,7 @@ class ConstantInt : public Constant { ConstantInt(const ConstantInt &); // DO NOT IMPLEMENT ConstantInt(const IntegerType *Ty, const APInt& V); APInt Val; + friend class LLVMContextImpl; protected: // allocate space for exactly zero operands void *operator new(size_t s) { @@ -102,10 +103,6 @@ public: return CreateTrueFalseVals(false); } - /// Return a ConstantInt with the specified value and an implied Type. The - /// type is the integer type that corresponds to the bit width of the value. - static ConstantInt *get(const APInt &V); - /// getType - Specialize the getType() method to always return an IntegerType, /// which reduces the amount of casting needed in parts of the compiler. /// diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 552e799..4aa2c20 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -93,6 +93,8 @@ public: ConstantInt* getConstantIntSigned(const IntegerType* Ty, int64_t V); Constant *getConstantIntSigned(const Type *Ty, int64_t V); + /// Return a ConstantInt with the specified value and an implied Type. The + /// type is the integer type that corresponds to the bit width of the value. ConstantInt* getConstantInt(const APInt& V); /// If Ty is a vector type, return a Constant with a splat of the given |