[clang] [llvm] Generate `DW_AT_RUST_short_backtrace` attributes for `DISubprogram` nodes (PR #123683)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 21:22:37 PST 2025


================
@@ -5658,10 +5658,27 @@ bool LLParser::parseDISubprogram(MDNode *&Result, bool IsDistinct) {
   OPTIONAL(retainedNodes, MDField, );                                          \
   OPTIONAL(thrownTypes, MDField, );                                            \
   OPTIONAL(annotations, MDField, );                                            \
+  OPTIONAL(shortBacktrace, MDSignedField, (-1, -1, 2));                        \
   OPTIONAL(targetFuncName, MDStringField, );
   PARSE_MD_FIELDS();
 #undef VISIT_MD_FIELDS
 
+  std::optional<ShortBacktraceAttr> parsedShortBacktrace;
+  switch (shortBacktrace.Val) {
+  case -1:
+    parsedShortBacktrace = std::nullopt;
----------------
DianQK wrote:

This requires a debug assertion.

https://github.com/llvm/llvm-project/pull/123683


More information about the llvm-commits mailing list