diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 01:26:06 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 01:26:06 +0000 |
commit | 3d29df3e8a203b167d8071ea6f805b21db18a5af (patch) | |
tree | 04e35fb85689b9621ea6ec76db47849335a87c5c /lib/Transforms/Instrumentation | |
parent | 8b8d31e3ec8c491a893307069ac123728c84782c (diff) | |
download | llvm-3d29df3e8a203b167d8071ea6f805b21db18a5af.tar.gz llvm-3d29df3e8a203b167d8071ea6f805b21db18a5af.tar.bz2 llvm-3d29df3e8a203b167d8071ea6f805b21db18a5af.tar.xz |
Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/BlockProfiling.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/EdgeProfiling.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/RSProfiling.cpp | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp index 913680cdd0..6dfcc0b051 100644 --- a/lib/Transforms/Instrumentation/BlockProfiling.cpp +++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp @@ -65,7 +65,7 @@ bool FunctionProfiler::runOnModule(Module &M) { const Type *ATy = Context->getArrayType(Type::Int32Ty, NumFunctions); GlobalVariable *Counters = - new GlobalVariable(ATy, false, GlobalValue::InternalLinkage, + new GlobalVariable(M.getContext(), ATy, false, GlobalValue::InternalLinkage, Context->getNullValue(ATy), "FuncProfCounters", &M); // Instrument all of the functions... @@ -110,7 +110,7 @@ bool BlockProfiler::runOnModule(Module &M) { const Type *ATy = Context->getArrayType(Type::Int32Ty, NumBlocks); GlobalVariable *Counters = - new GlobalVariable(ATy, false, GlobalValue::InternalLinkage, + new GlobalVariable(M.getContext(), ATy, false, GlobalValue::InternalLinkage, Context->getNullValue(ATy), "BlockProfCounters", &M); // Instrument all of the blocks... diff --git a/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/lib/Transforms/Instrumentation/EdgeProfiling.cpp index 88825b164c..b625341273 100644 --- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp +++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp @@ -66,7 +66,7 @@ bool EdgeProfiler::runOnModule(Module &M) { const Type *ATy = Context->getArrayType(Type::Int32Ty, NumEdges); GlobalVariable *Counters = - new GlobalVariable(ATy, false, GlobalValue::InternalLinkage, + new GlobalVariable(M.getContext(), ATy, false, GlobalValue::InternalLinkage, Context->getNullValue(ATy), "EdgeProfCounters", &M); // Instrument all of the edges... diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index e487d2fb47..0999a279ef 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -198,7 +198,8 @@ GlobalRandomCounter::GlobalRandomCounter(Module& M, const IntegerType* t, uint64_t resetval) : T(t) { ConstantInt* Init = M.getContext().getConstantInt(T, resetval); ResetValue = Init; - Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage, + Counter = new GlobalVariable(M.getContext(), T, false, + GlobalValue::InternalLinkage, Init, "RandomSteeringCounter", &M); } @@ -237,7 +238,8 @@ GlobalRandomCounterOpt::GlobalRandomCounterOpt(Module& M, const IntegerType* t, : AI(0), T(t) { ConstantInt* Init = M.getContext().getConstantInt(T, resetval); ResetValue = Init; - Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage, + Counter = new GlobalVariable(M.getContext(), T, false, + GlobalValue::InternalLinkage, Init, "RandomSteeringCounter", &M); } |