[RuntimeDyld] Add 'stub_addr' to comment describing RuntimeDyldChecker's syntax.
[oota-llvm.git] / include / llvm / ExecutionEngine / RuntimeDyldChecker.h
index 276abffc0202012fe80b71da489ea3581edf8ac4..23936a6209bfd74ae8cfed98aaaca6c0730620d8 100644 (file)
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_RUNTIMEDYLDCHECKER_H
-#define LLVM_RUNTIMEDYLDCHECKER_H
+#ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
+#define LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
 
 #include "llvm/ADT/StringRef.h"
 
@@ -52,6 +52,7 @@ class raw_ostream;
 ///
 /// ident_expr = 'decode_operand' '(' symbol ',' operand-index ')'
 ///            | 'next_pc'        '(' symbol ')'
+///            | 'stub_addr' '(' file-name ',' section-name ',' symbol ')'
 ///            | symbol
 ///
 /// binary_expr = expr '+' expr
@@ -67,6 +68,12 @@ public:
                      MCInstPrinter *InstPrinter, raw_ostream &ErrStream);
   ~RuntimeDyldChecker();
 
+  // \brief Get the associated RTDyld instance.
+  RuntimeDyld& getRTDyld();
+
+  // \brief Get the associated RTDyld instance.
+  const RuntimeDyld& getRTDyld() const;
+
   /// \brief Check a single expression against the attached RuntimeDyld
   ///        instance.
   bool check(StringRef CheckExpr) const;
@@ -76,10 +83,20 @@ public:
   ///        method to be evaluated as an expression.
   bool checkAllRulesInBuffer(StringRef RulePrefix, MemoryBuffer *MemBuf) const;
 
+  /// \brief Returns the address of the requested section (or an error message
+  ///        in the second element of the pair if the address cannot be found).
+  ///
+  /// if 'LinkerAddress' is true, this returns the address of the section
+  /// within the linker's memory. If 'LinkerAddress' is false it returns the
+  /// address within the target process (i.e. the load address).
+  std::pair<uint64_t, std::string> getSectionAddr(StringRef FileName,
+                                                  StringRef SectionName,
+                                                  bool LinkerAddress);
+
 private:
   std::unique_ptr<RuntimeDyldCheckerImpl> Impl;
 };
 
 } // end namespace llvm
 
-#endif // LLVM_RUNTIMEDYLDCHECKER_H
+#endif