diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2013-08-21 07:28:17 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2013-08-21 07:28:17 +0000 |
commit | 46d353f8e8a2bbe02e8aa6a2292eae930dd3b7e6 (patch) | |
tree | 9cc756b7e0d63078710d8bded8550623272474ae /include | |
parent | 9bfc0626c02e449dd321a71a09f005ac8239e921 (diff) | |
download | llvm-46d353f8e8a2bbe02e8aa6a2292eae930dd3b7e6.tar.gz llvm-46d353f8e8a2bbe02e8aa6a2292eae930dd3b7e6.tar.bz2 llvm-46d353f8e8a2bbe02e8aa6a2292eae930dd3b7e6.tar.xz |
MC CFG: Add a few needed methods, mainly MCModule::findFirstAtomAfter.
While there, do some minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCFunction.h | 6 | ||||
-rw-r--r-- | include/llvm/MC/MCModule.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/MC/MCFunction.h b/include/llvm/MC/MCFunction.h index a87b9488d3..697b5006a9 100644 --- a/include/llvm/MC/MCFunction.h +++ b/include/llvm/MC/MCFunction.h @@ -97,6 +97,12 @@ public: StringRef getName() const { return Name; } + /// \name Get the owning MC Module. + /// @{ + const MCModule *getParent() const { return ParentModule; } + MCModule *getParent() { return ParentModule; } + /// @} + /// \name Access to the function's basic blocks. No ordering is enforced, /// except that the first block is the entry block. /// @{ diff --git a/include/llvm/MC/MCModule.h b/include/llvm/MC/MCModule.h index a145653af7..c0c242c21a 100644 --- a/include/llvm/MC/MCModule.h +++ b/include/llvm/MC/MCModule.h @@ -43,7 +43,9 @@ class MCModule { typedef std::vector<MCAtom*> AtomListTy; AtomListTy Atoms; + // For access to map/remap. friend class MCAtom; + /// \brief Remap \p Atom to the given range, and update its Begin/End fields. /// \param Atom An atom belonging to this module. /// An atom should always use this method to update its bounds, because this @@ -83,6 +85,8 @@ public: /// @{ const MCAtom *findAtomContaining(uint64_t Addr) const; MCAtom *findAtomContaining(uint64_t Addr); + const MCAtom *findFirstAtomAfter(uint64_t Addr) const; + MCAtom *findFirstAtomAfter(uint64_t Addr); typedef AtomListTy::const_iterator const_atom_iterator; typedef AtomListTy:: iterator atom_iterator; |