[PATCH] D84386: [DWARFYAML] Add support for emitting custom operands for range list entry.
    James Henderson via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jul 23 02:01:12 PDT 2020
    
    
  
jhenderson added a subscriber: grimar.
jhenderson added a comment.
In general terms, I think this is a good solution. Let's see what @grimar and @labath think.
================
Comment at: llvm/include/llvm/ObjectYAML/DWARFYAML.h:188
 
+enum ListEntryOperandTypes {
+  Unsigned8,
----------------
`enum class`?
================
Comment at: llvm/include/llvm/ObjectYAML/DWARFYAML.h:439-445
+    io.enumCase(value, "Unsigned8",
+                DWARFYAML::ListEntryOperandTypes::Unsigned8);
+    io.enumCase(value, "Unsigned16",
+                DWARFYAML::ListEntryOperandTypes::Unsigned16);
+    io.enumCase(value, "Unsigned32",
+                DWARFYAML::ListEntryOperandTypes::Unsigned32);
+    io.enumCase(value, "Unsigned64",
----------------
It might be nice to call these `U8`, `U16` etc, to make them nice and concise.
================
Comment at: llvm/test/tools/yaml2obj/ELF/DWARF/debug-rnglists.yaml:655-661
+## t) Test that yaml2obj emits an error message if we specify an unrecognized operator but don't
+## specify the type(s) for its operand(s).
+
+# RUN: not yaml2obj --docnum=18 %s 2>&1 | \
+# RUN:   FileCheck %s --check-prefix=UNRECOGNIZED
+
+# UNRECOGNIZED: yaml2obj: error: unrecognized operator: 0xFF
----------------
Maybe we should just treat this case as having no operands automatically?
================
Comment at: llvm/test/tools/yaml2obj/ELF/DWARF/debug-rnglists.yaml:676
+## u) Test that yaml2obj emits an error message if the number of operands doesn't match
+## the number of their types.
+
----------------
I think you can just delete "their" here.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84386/new/
https://reviews.llvm.org/D84386
    
    
More information about the llvm-commits
mailing list