diff options
| author | Dan Gohman <gohman@apple.com> | 2008-05-23 21:05:58 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-05-23 21:05:58 +0000 |
| commit | f96e1371e85a5b6be0d787f56e5882e7b63eefc7 (patch) | |
| tree | db75aafa57099ddbeac35a41a9b9250a1b89fb2e /llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp | |
| parent | c11802a521b48dc3626fcaac3ff73f5847acd33e (diff) | |
| download | bcm5719-llvm-f96e1371e85a5b6be0d787f56e5882e7b63eefc7.tar.gz bcm5719-llvm-f96e1371e85a5b6be0d787f56e5882e7b63eefc7.zip | |
Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.
llvm-svn: 51499
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp index d94522f6c7d..48071f11569 100644 --- a/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp +++ b/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp @@ -100,8 +100,8 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, GlobalValue *CounterArray) { // Insert the increment after any alloca or PHI instructions... - BasicBlock::iterator InsertPos = BB->begin(); - while (isa<AllocaInst>(InsertPos) || isa<PHINode>(InsertPos)) + BasicBlock::iterator InsertPos = BB->getFirstNonPHI(); + while (isa<AllocaInst>(InsertPos)) ++InsertPos; // Create the getelementptr constant expression |

