[PATCH] D73462: [dwarf-5] Support DebugInfo for Defaulted parameters for C++ templates

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 16:40:53 PST 2020


dblaikie added a comment.

Might be easier in smaller patches - Bitcode & IR support, then LLVM/codegen emission and Clang/IR gen.

> I have to update dityperefs-3.8.ll and dityperefs-3.8.ll.bc because they are no longer compatible with this patch.

The bitcode files in test/Bitcode generally shouldn't be updated - they're there to test backwards compatibility with older bitcode.



================
Comment at: llvm/lib/IR/AsmWriter.cpp:2074-2075
   Printer.printMetadata("type", N->getRawType(), /* ShouldSkipNull */ false);
+  if (Context->getDwarfVersion() >= 5)
+    Printer.printBool("defaulted", N->isDefault());
   Out << ")";
----------------
Remove this condition & emit defaulted unconditionally.

Include the "default" value of false as the 3rd argument to printBool so we don't add this textual element to every DITemplateTypeParameter.


================
Comment at: llvm/lib/IR/AsmWriter.cpp:2090-2091
   Printer.printMetadata("type", N->getRawType());
+  if (Context->getDwarfVersion() >= 5)
+    Printer.printBool("defaulted", N->isDefault());
   Printer.printMetadata("value", N->getValue(), /* ShouldSkipNull */ false);
----------------
Same feedback as with the type parameter case.


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

https://reviews.llvm.org/D73462





More information about the llvm-commits mailing list