summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2013-08-21 07:27:59 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2013-08-21 07:27:59 +0000
commitf9e2348e948451d30e4e0593e0beb3bcc31da8da (patch)
tree8db3fa7301db0aad0c21dc7b08cb3f90fd6de018 /include
parent7dac32d07d54231ba203f7c32f3a9f8e6730810f (diff)
downloadllvm-f9e2348e948451d30e4e0593e0beb3bcc31da8da.tar.gz
llvm-f9e2348e948451d30e4e0593e0beb3bcc31da8da.tar.bz2
llvm-f9e2348e948451d30e4e0593e0beb3bcc31da8da.tar.xz
MC CFG: Add more MCFunction container methods (find, empty).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCFunction.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/MC/MCFunction.h b/include/llvm/MC/MCFunction.h
index 4c75cd4c25..a87b9488d3 100644
--- a/include/llvm/MC/MCFunction.h
+++ b/include/llvm/MC/MCFunction.h
@@ -97,13 +97,15 @@ public:
StringRef getName() const { return Name; }
- /// \name Access to the function's basic blocks. No ordering is enforced.
+ /// \name Access to the function's basic blocks. No ordering is enforced,
+ /// except that the first block is the entry block.
/// @{
/// \brief Get the entry point basic block.
const MCBasicBlock *getEntryBlock() const { return front(); }
MCBasicBlock *getEntryBlock() { return front(); }
- // NOTE: Dereferencing iterators gives pointers, so maybe a list is best here.
+ bool empty() const { return Blocks.empty(); }
+
typedef BasicBlockListTy::const_iterator const_iterator;
typedef BasicBlockListTy:: iterator iterator;
const_iterator begin() const { return Blocks.begin(); }
@@ -115,6 +117,10 @@ public:
MCBasicBlock* front() { return Blocks.front(); }
const MCBasicBlock* back() const { return Blocks.back(); }
MCBasicBlock* back() { return Blocks.back(); }
+
+ /// \brief Find the basic block, if any, that starts at \p StartAddr.
+ const MCBasicBlock *find(uint64_t StartAddr) const;
+ MCBasicBlock *find(uint64_t StartAddr);
/// @}
};