[PATCH] D84383: [DWARFYAML] Pull out common helper functions for rnglist and loclist tables. NFC.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 01:55:16 PDT 2020


grimar added inline comments.


================
Comment at: llvm/lib/ObjectYAML/DWARFEmitter.cpp:454
+        Values.size(), EncodingString.str().c_str(), ExpectedOperands);
+  }
+
----------------
nit: you do not need curly braces around `return createStringError....`


================
Comment at: llvm/lib/ObjectYAML/DWARFEmitter.cpp:482
+    return checkListEntryOperands(EncodingName, Entry.Values, ExpectedOperands);
   };
 
----------------
It looks like you could pass `const DWARFYAML::RnglistEntry &Entry` directly to `checkListEntryOperands`

i.e.:

```
static Error checkListEntryOperands(const DWARFYAML::RnglistEntry &Entry, uint64_t ExpectedOpsNum) {
  StringRef EncodingName = dwarf::RangeListEncodingString(Entry.Operator);
...
}
```

and then avoid having the `CheckOperands` helper? (inline `checkListEntryOperands`)




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84383/new/

https://reviews.llvm.org/D84383





More information about the llvm-commits mailing list