summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-16 18:04:31 +0000
committerOwen Anderson <resistor@mac.com>2009-07-16 18:04:31 +0000
commit20b34ac794d15256953f5807c4cbe2cbe16ae5e6 (patch)
tree38ac5c7c3e222e1ccb694083c6ddec81ca81b231 /llvm/include
parentca75db7c02c7c452cde8c8f56c898dff1c1b3e95 (diff)
downloadbcm5719-llvm-20b34ac794d15256953f5807c4cbe2cbe16ae5e6.tar.gz
bcm5719-llvm-20b34ac794d15256953f5807c4cbe2cbe16ae5e6.zip
Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here llvm-svn: 76089
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Analysis/LoopPass.h1
-rw-r--r--llvm/include/llvm/CallGraphSCCPass.h2
-rw-r--r--llvm/include/llvm/Constants.h5
-rw-r--r--llvm/include/llvm/LLVMContext.h2
4 files changed, 6 insertions, 4 deletions
diff --git a/llvm/include/llvm/Analysis/LoopPass.h b/llvm/include/llvm/Analysis/LoopPass.h
index 7659b5bf458..a6a23c6b61c 100644
--- a/llvm/include/llvm/Analysis/LoopPass.h
+++ b/llvm/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/llvm/include/llvm/CallGraphSCCPass.h b/llvm/include/llvm/CallGraphSCCPass.h
index d5ff17cf247..8d5d7c3edfb 100644
--- a/llvm/include/llvm/CallGraphSCCPass.h
+++ b/llvm/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/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h
index e06ce1f1b9e..df086416a8e 100644
--- a/llvm/include/llvm/Constants.h
+++ b/llvm/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/llvm/include/llvm/LLVMContext.h b/llvm/include/llvm/LLVMContext.h
index 552e7992c6d..4aa2c20ec28 100644
--- a/llvm/include/llvm/LLVMContext.h
+++ b/llvm/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
OpenPOWER on IntegriCloud