[PATCH] [dwarfdump] Resolve also variable specifications/abstract_origins.

Frederic Riss friss at apple.com
Thu Oct 9 09:26:17 PDT 2014


================
Comment at: lib/DebugInfo/DWARFDebugInfoEntry.h:139
@@ +138,3 @@
+  getName(const DWARFUnit *U,
+          DILineInfoSpecifier::FunctionNameKind Kind,
+          bool SearchOnlySubroutine = false) const;
----------------
samsonov wrote:
> DILineInfoSpecifier::FunctionNameKind looks kind of weird here. Maybe, you should just add a custom enum that would set the kind of name you want to fetch from the DIE (in this way, you might never need to handle FunctionNameKind::None, for instance). Why do you need a SearchOnlySubroutine argument? I don't think a suprogram DIE can refer to a variable DIE via DW_AT_specification attribute.
> 
FunctionNameKind is part of the public DebugInfo interface. I'm not that fond of adding another enum with a very similar meaning (just leaving the None out). How about I move FunctionNameKind out of DILineInfoSpecifier and rename it to something like DINameKind ? I'll still have to deal with the None case, but at least the type passed to getName would be a bit more sensical.

I put the SearchOnlySubroutine parameter to preserve the exact semantic of the getSubroutineName method which checks the type of DIE at each recursive invocation. As said in the patch log, I can remove that parameter and have the DIE type check be done  only on the root search DIE (I'd find this nicer myself).

If I don't here any opposition to the above, I'll resubmit with these changes.

http://reviews.llvm.org/D5625






More information about the llvm-commits mailing list