diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-04-05 04:20:27 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-04-05 04:20:27 +0000 |
commit | 1a7744501a80351ce31fcecad42c8e35823bc081 (patch) | |
tree | 4274e622c545eb18b6ab88bc09b3366abea58538 /include | |
parent | f05b1dcf870346094f8aaee8e387c92d3e47e98d (diff) | |
download | external_llvm-1a7744501a80351ce31fcecad42c8e35823bc081.zip external_llvm-1a7744501a80351ce31fcecad42c8e35823bc081.tar.gz external_llvm-1a7744501a80351ce31fcecad42c8e35823bc081.tar.bz2 |
Cache the fairly expensive last split point computation and provide a fast
inlined path for the common case.
Most basic blocks don't contain a call that may throw, so the last split point
os simply the first terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 5a6581c..ad12157 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -305,6 +305,10 @@ public: /// it returns end() iterator getFirstTerminator(); + const_iterator getFirstTerminator() const { + return const_cast<MachineBasicBlock*>(this)->getFirstTerminator(); + } + /// getLastNonDebugInstr - returns an iterator to the last non-debug /// instruction in the basic block, or end() iterator getLastNonDebugInstr(); |