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
This commit is contained in:
Owen Anderson
2009-07-06 18:42:36 +00:00
parent e034393b15
commit 508955156a
21 changed files with 256 additions and 195 deletions

View File

@ -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 @@ bool EdgeProfiler::runOnModule(Module &M) {
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;