MC CFG: Add entrypoint address to MCModule.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 21 Aug 2013 07:28:02 +0000 (07:28 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 21 Aug 2013 07:28:02 +0000 (07:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188877 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCModule.h

index 6d493628b7c421c1961a31db684f9135f2a90762..a145653af79c726e521d861cfd66edb7012cd812 100644 (file)
@@ -60,14 +60,17 @@ class MCModule {
   FunctionListTy Functions;
   /// @}
 
+  /// The address of the entrypoint function.
+  uint64_t Entrypoint;
+
   MCModule           (const MCModule &) LLVM_DELETED_FUNCTION;
   MCModule& operator=(const MCModule &) LLVM_DELETED_FUNCTION;
 
   // MCObjectDisassembler creates MCModules.
   friend class MCObjectDisassembler;
-  MCModule() : Atoms() { }
 
 public:
+  MCModule() : Entrypoint(0) { }
   ~MCModule();
 
   /// \name Create a new MCAtom covering the specified offset range.
@@ -101,6 +104,9 @@ public:
   const_func_iterator func_end()   const { return Functions.end(); }
         func_iterator func_end()         { return Functions.end(); }
   /// @}
+
+  /// \brief Get the address of the entrypoint function, or 0 if there is none.
+  uint64_t getEntrypoint() const { return Entrypoint; }
 };
 
 }