summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2013-08-21 07:28:17 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2013-08-21 07:28:17 +0000
commit46d353f8e8a2bbe02e8aa6a2292eae930dd3b7e6 (patch)
tree9cc756b7e0d63078710d8bded8550623272474ae /include
parent9bfc0626c02e449dd321a71a09f005ac8239e921 (diff)
downloadllvm-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.h6
-rw-r--r--include/llvm/MC/MCModule.h4
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;