dblaikie added a comment.

(This should be committed in two parts - the LLVM part first, then the Clang 
part - since they can be separated, they should be - but happy to review it 
altogether)



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1856
+
+bool DwarfUnit::shouldEmitTemplateDefaultAttr() const {
+  assert(Asm != nullptr);
----------------
Maybe this could be a more general function? It could take a version and then 
have a general name "isCompatibleWithVersion(X)" and be used for other strict 
DWARF+version checks?


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1857-1858
+bool DwarfUnit::shouldEmitTemplateDefaultAttr() const {
+  assert(Asm != nullptr);
+  assert(DD != nullptr);
+  return !Asm->TM.Options.DebugStrictDwarf || DD->getDwarfVersion() >= 5;
----------------
You can drop these - there's tons of non-null assumptions throughout the 
codebase, most aren't asserted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139928

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to