[PATCH] D93460: [dsymutil][DWARFLinker][NFC] Refactor usages of UniquingStringPool.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 09:40:18 PST 2020


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM with the comments and clang-tidy warning addressed.



================
Comment at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:158
+  StringRef getResolvedPath(CompileUnit &CU, unsigned FileNum,
+                            const DWARFDebugLine::LineTable &LineTable) {
+    std::pair<unsigned, unsigned> Key = {CU.getUniqueID(), FileNum};
----------------
Can this be implemented in the cpp file?


================
Comment at: llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp:91-98
+  bool IsAnonimousNamespace = false;
+
+  if (NameRef.empty() && Tag == dwarf::DW_TAG_namespace) {
     // FIXME: For dsymutil-classic compatibility. I think uniquing within
     // anonymous namespaces is wrong. There is no ODR guarantee there.
-    NameRef = StringPool.internString("(anonymous namespace)");
-
-  if (ShortName && ShortName != Name)
-    ShortNameRef = StringPool.internString(ShortName);
-  else
-    ShortNameRef = NameRef;
+    NameRef = "(anonymous namespace)";
+    IsAnonimousNamespace = true;
----------------
dblaikie wrote:
> Spelling correction.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93460/new/

https://reviews.llvm.org/D93460



More information about the llvm-commits mailing list