[PATCH] [ dwarfdump ] Add symbolic dump of known DWARF attribute values.

David Blaikie dblaikie at gmail.com
Thu Sep 4 10:02:58 PDT 2014

Looks good with your responses (& implied/pending updates) to the last round of comments, please commit once you've made those changes.

Comment at: lib/Support/Dwarf.cpp:799
@@ +798,3 @@
+const char *llvm::dwarf::AttributeValueString(uint16_t Attr, unsigned Val) {
+  switch (Attr) {
friss wrote:
> dblaikie wrote:
> > dblaikie wrote:
> > > As a follow-up, if you like, all these functions should /probably/ be modified to return StringRef, that way we don't have to compute their length later on (or do null-test walks) in printing functions, etc.
> > Should the type of Attr be something more type-safe? (the actual enum of DWARF attributes)
> I first wrote it like that, but I was finding the cast at the call site awkward. I can add it back, but we have no guarantee that the data we've read from the DWARF file will actually be a known Attribute, thus I find it more accurate to allow all values.
Fair enough.


More information about the llvm-commits mailing list