[PATCH] D48988: Debug prefix map for machine code emission

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 15:02:56 PDT 2018


compnerd added inline comments.


================
Comment at: include/llvm/MC/MCContext.h:503
+    void addDebugPrefixMapEntry(const std::string& From, const std::string& To);
+
     /// Get the main file name for use in error messages and debug
----------------
clang-format please - your `&` are bound to the wrong side


================
Comment at: lib/MC/MCContext.cpp:538
 
+void MCContext::addDebugPrefixMapEntry(const std::string& From, const std::string& To) {
+  DebugPrefixMap.insert(std::make_pair(From, To));
----------------
please clang-format this - your `&` are bound to the wrong side.


================
Comment at: lib/MC/MCDwarf.cpp:405
     // Record path strings, emit references here.
-    LineStr->emitRef(MCOS, CompDir);
-    for (auto &Dir : MCDwarfDirs)
-      LineStr->emitRef(MCOS, Dir);
+    LineStr->emitRef(MCOS, RemappedCompDir);
+    for (auto &Dir : MCDwarfDirs) {
----------------
mmm, should this really apply to the compilation directory?


================
Comment at: lib/MC/MCDwarf.cpp:406
+    LineStr->emitRef(MCOS, RemappedCompDir);
+    for (auto &Dir : MCDwarfDirs) {
+      const std::string RemappedDir = remapDebugPath(MCOS, Dir);
----------------
Since you are changing the line, please make this `const auto &`.


Repository:
  rL LLVM

https://reviews.llvm.org/D48988





More information about the llvm-commits mailing list