diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 19:03:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 19:03:57 +0000 |
commit | b17f32945fa6dd8e552a16cc5273bba5805cf4e4 (patch) | |
tree | b8383165ab804187660d5c8eddb2dc7486730b93 /llvm/lib/Transforms/Instrumentation | |
parent | d5ffa8ffb62df34c6fa3ba8ec4c29b2ea2891ad0 (diff) | |
download | bcm5719-llvm-b17f32945fa6dd8e552a16cc5273bba5805cf4e4.tar.gz bcm5719-llvm-b17f32945fa6dd8e552a16cc5273bba5805cf4e4.zip |
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/RSProfiling.cpp | 10 |
3 files changed, 10 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp b/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp index 6dfcc0b0512..440f59b37d7 100644 --- a/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp @@ -65,8 +65,8 @@ bool FunctionProfiler::runOnModule(Module &M) { const Type *ATy = Context->getArrayType(Type::Int32Ty, NumFunctions); GlobalVariable *Counters = - new GlobalVariable(M.getContext(), ATy, false, GlobalValue::InternalLinkage, - Context->getNullValue(ATy), "FuncProfCounters", &M); + new GlobalVariable(M, ATy, false, GlobalValue::InternalLinkage, + Context->getNullValue(ATy), "FuncProfCounters"); // Instrument all of the functions... unsigned i = 0; @@ -110,8 +110,8 @@ bool BlockProfiler::runOnModule(Module &M) { const Type *ATy = Context->getArrayType(Type::Int32Ty, NumBlocks); GlobalVariable *Counters = - new GlobalVariable(M.getContext(), ATy, false, GlobalValue::InternalLinkage, - Context->getNullValue(ATy), "BlockProfCounters", &M); + new GlobalVariable(M, ATy, false, GlobalValue::InternalLinkage, + Context->getNullValue(ATy), "BlockProfCounters"); // Instrument all of the blocks... unsigned i = 0; diff --git a/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp index b625341273a..c3ec4b92f07 100644 --- a/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp @@ -66,8 +66,8 @@ bool EdgeProfiler::runOnModule(Module &M) { const Type *ATy = Context->getArrayType(Type::Int32Ty, NumEdges); GlobalVariable *Counters = - new GlobalVariable(M.getContext(), ATy, false, GlobalValue::InternalLinkage, - Context->getNullValue(ATy), "EdgeProfCounters", &M); + new GlobalVariable(M, ATy, false, GlobalValue::InternalLinkage, + Context->getNullValue(ATy), "EdgeProfCounters"); // Instrument all of the edges... unsigned i = 0; diff --git a/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp b/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp index 0999a279ef0..51012209539 100644 --- a/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -198,9 +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(M.getContext(), T, false, - GlobalValue::InternalLinkage, - Init, "RandomSteeringCounter", &M); + Counter = new GlobalVariable(M, T, false, GlobalValue::InternalLinkage, + Init, "RandomSteeringCounter"); } GlobalRandomCounter::~GlobalRandomCounter() {} @@ -238,9 +237,8 @@ GlobalRandomCounterOpt::GlobalRandomCounterOpt(Module& M, const IntegerType* t, : AI(0), T(t) { ConstantInt* Init = M.getContext().getConstantInt(T, resetval); ResetValue = Init; - Counter = new GlobalVariable(M.getContext(), T, false, - GlobalValue::InternalLinkage, - Init, "RandomSteeringCounter", &M); + Counter = new GlobalVariable(M, T, false, GlobalValue::InternalLinkage, + Init, "RandomSteeringCounter"); } GlobalRandomCounterOpt::~GlobalRandomCounterOpt() {} |