[PATCH] D143966: [DebugInfo][BPF] Add 'annotations' field for DIBasicType & DISubroutineType

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 12:43:28 PDT 2023


dblaikie added a comment.

Seems generally OK.

As for the design - could this maybe have been a decorator on a type? (or are there other uses for annotations) more like how `DW_TAG_const_type` works, for instance?

And presumably the back-compat can be removed from LLVM once linux has updated pahole/whatever your support timeline is for LLVM (like how many old kernel versions are supported by recent LLVM) - rather than once Linux has dropped support for an LLVM that's old enough not to have the new feature (that milestone is when Linux can remove the backcompat support from pahole, rather than when LLVM can remove support for the old format).



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:698-716
+  // An unspecified type only has a name attribute & annotations.
+  if (BTy->getTag() == dwarf::DW_TAG_unspecified_type) {
+    addAnnotation(Buffer, BTy->getAnnotations());
     return;
+  }
 
   if (BTy->getTag() != dwarf::DW_TAG_string_type)
----------------
perhaps emit the annotations before the early-exit for unspecified type? (same way name is added before that) so it only has to be done once


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143966



More information about the llvm-commits mailing list