aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/BasicBlock.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-16 20:42:52 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-16 20:42:52 +0000
commitd2e103daf8a093e0e25ddbaa7549c083887196e8 (patch)
tree00c12a4a051f81761d059f373a9f46747a812629 /include/llvm/BasicBlock.h
parent23b49ba6d55972fdffdfd4ed37edcf067bb60f3c (diff)
Add getFirstInsertionPt() method.
getFirstInsertionPt() returns an iterator to the first insertion point in a basic block. This is after all PHIs and any other instruction which is required to be at the top of the basic block (like LandingPadInst). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r--include/llvm/BasicBlock.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index d5966290a1..a031650bb3 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -145,6 +145,15 @@ public:
return const_cast<BasicBlock*>(this)->getFirstNonPHIOrDbgOrLifetime();
}
+ /// getFirstInsertionPt - Returns an iterator to the first instruction in this
+ /// block that is suitable for inserting a non-PHI instruction. In particular,
+ /// it skips all PHIs and LandingPad instructions. Returns 0 if there are no
+ /// non-PHI instructions.
+ iterator getFirstInsertionPt();
+ const_iterator getFirstInsertionPt() const {
+ return const_cast<BasicBlock*>(this)->getFirstInsertionPt();
+ }
+
/// removeFromParent - This method unlinks 'this' from the containing
/// function, but does not delete it.
///