Thread LLVMContext through the constant folding APIs, which touches a lot of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74844 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
index 0831f3b..88825b1 100644
--- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp
+++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
@@ -20,6 +20,7 @@
#include "ProfilingUtils.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
+#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/Compiler.h"
@@ -63,10 +64,10 @@
NumEdges += BB->getTerminator()->getNumSuccessors();
}
- const Type *ATy = ArrayType::get(Type::Int32Ty, NumEdges);
+ const Type *ATy = Context->getArrayType(Type::Int32Ty, NumEdges);
GlobalVariable *Counters =
new GlobalVariable(ATy, false, GlobalValue::InternalLinkage,
- Constant::getNullValue(ATy), "EdgeProfCounters", &M);
+ Context->getNullValue(ATy), "EdgeProfCounters", &M);
// Instrument all of the edges...
unsigned i = 0;