Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp
index 913680c..6dfcc0b 100644
--- a/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp
@@ -65,7 +65,7 @@
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 @@
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 88825b1..b625341 100644
--- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp
+++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
@@ -66,7 +66,7 @@
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 e487d2f..0999a27 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -198,7 +198,8 @@
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 @@
: 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);
}