[PATCH] D26013: Change DWARF parser to use enumerations for DWARF tags, attributes and forms.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 17:11:06 PDT 2016

clayborg added a comment.

I will make the changes dblaikie suggested.

Comment at: lib/DebugInfo/DWARF/DWARFFormValue.cpp:125-126
   case DW_FORM_GNU_strp_alt:
     return (FC == FC_String);
+  default:
+    break;
This was added because the switch statement was on a uint16_t before and now it is on a dwarf::Form enumeration. It will warn that not all cases were handled. The cases don't include all cases because most case are handled above the current switch statement. So this was added to avoid a "not all enum cases were handled.

Comment at: lib/DebugInfo/DWARF/DWARFFormValue.cpp:278-280
+    // Cast to uint16_t so we don't get a warning about all cases covered
+    // since we might dump newer DWARF someday that will have unsupported
+    // DW_FORM enumerations
dblaikie wrote:
> Perhaps it'd work to have enums defined for the beginning of the user-defined extension space - and just never add support for those to these switches, then they wouldn't be fully covered switches and the warning wouldn't fire on the default?
That is a good idea. I will do that.



More information about the llvm-commits mailing list