[PATCH] Make it easier to use DwarfContext with MCJIT

Eric Christopher echristo at gmail.com
Thu May 21 13:04:32 PDT 2015


Few more inline comments.


REPOSITORY
  rL LLVM

================
Comment at: include/llvm/DebugInfo/DIContext.h:147
@@ +146,3 @@
+
+  /// \brief Obtain the Load Address of a section by Name
+  ///
----------------
Sentences end with a period. Also we have \brief support turned on so you don't need to use \brief anymore. (And in the other places :)

================
Comment at: include/llvm/DebugInfo/DIContext.h:173
@@ +172,3 @@
+  /// The caller is responsible for deallocation once the copy is no longer required.
+  virtual LoadedObjectInfo *clone() const = 0;
+};
----------------
clone is entirely unused.

================
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:685-687
@@ +684,5 @@
+          Sym->getSection(RSec);
+        } else if (RSec != Obj.section_end()) {
+          SymAddr = RSec->getAddress();
+        }
+
----------------
LLVM style is that single statement blocks don't get braces if possible.

================
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:700-702
@@ +699,5 @@
+          SectionLoadAddress = L->getSectionLoadAddress(SecName);
+          if (SectionLoadAddress != 0) {
+            SymAddr += SectionLoadAddress - RSec->getAddress();
+          }
+        }
----------------
Ditto.

================
Comment at: tools/llvm-rtdyld/llvm-rtdyld.cpp:261-269
@@ -247,2 +260,11 @@
 
-        outs() << "Function: " << Name << ", Size = " << Size << "\n";
+        if (!UseDebugObj) {
+          object::section_iterator Sec(SymbolObj->section_end());
+          I->getSection(Sec);
+          StringRef SecName;
+          Sec->getName(SecName);
+          uint64_t SectionLoadAddress = LoadObjects ? LoadedObjInfo->getSectionLoadAddress(SecName) : 0;
+          if (SectionLoadAddress != 0)
+            Addr += SectionLoadAddress - Sec->getAddress();
+        }
+
----------------
Explanatory comment here. (It looks obvious, but I like them in general. :)

http://reviews.llvm.org/D6961

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list