aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/BlockProfiling.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 00:44:37 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 00:44:37 +0000
commit518310cb0d136906ff0a99d7a24cb460794de5bf (patch)
treed8ad6b32edf261c90ce2c190f4c74dc3d044502f /lib/Transforms/Instrumentation/BlockProfiling.cpp
parent593eb952281138e1877adbfb11b88b6e32fdd732 (diff)
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/BlockProfiling.cpp')
-rw-r--r--lib/Transforms/Instrumentation/BlockProfiling.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp
index b7c19e6e09..e357e841cd 100644
--- a/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp
@@ -55,14 +55,12 @@ bool FunctionProfiler::run(Module &M) {
new GlobalVariable(ATy, false, GlobalValue::InternalLinkage,
Constant::getNullValue(ATy), "FuncProfCounters", &M);
- ConstantPointerRef *CounterCPR = ConstantPointerRef::get(Counters);
-
// Instrument all of the functions...
unsigned i = 0;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal())
// Insert counter at the start of the function
- IncrementCounterInBlock(I->begin(), i++, CounterCPR);
+ IncrementCounterInBlock(I->begin(), i++, Counters);
// Add the initialization call to main.
InsertProfilingInitCall(Main, "llvm_start_func_profiling", Counters);
@@ -96,14 +94,12 @@ bool BlockProfiler::run(Module &M) {
new GlobalVariable(ATy, false, GlobalValue::InternalLinkage,
Constant::getNullValue(ATy), "BlockProfCounters", &M);
- ConstantPointerRef *CounterCPR = ConstantPointerRef::get(Counters);
-
// Instrument all of the blocks...
unsigned i = 0;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
for (Function::iterator BB = I->begin(), E = I->end(); BB != E; ++BB)
// Insert counter at the start of the block
- IncrementCounterInBlock(BB, i++, CounterCPR);
+ IncrementCounterInBlock(BB, i++, Counters);
// Add the initialization call to main.
InsertProfilingInitCall(Main, "llvm_start_block_profiling", Counters);