Push LLVMContext through GlobalVariables and IRBuilder.
[oota-llvm.git] / lib / Transforms / Instrumentation / BlockProfiling.cpp
index 913680cdd09f5ccfcff1f04ca02926ded0587b49..6dfcc0b0512e28b88639b22f5e81d51568be0356 100644 (file)
@@ -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...