This patch helps pull out some common helper functions for range list
and location list tables. NFC.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
|---|---|---|
| 454 | nit: you do not need curly braces around return createStringError.... | |
| 482 | 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) | |
| llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
|---|---|---|
| 482 | My idea is having StringRef EncodingName = dwarf::RangeListEncodingString(Entry.Operator);
auto CheckOperands = [&](uint64_t ExpectedOperands) -> Error {
return checkListEntryOperands(EncodingName, Entry.Values, ExpectedOperands);
};for the range list table and StringRef EncodingName = dwarf::LocListEncodingString(Entry.Operator);
auto CheckOperands = [&](uint64_t ExpectedOperands) -> Error {
return checkListEntryOperands(EncodingName, Entry.Values, ExpectedOperands);
};for the location list table. | |
| llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
|---|---|---|
| 482 | Ah, OK. | |
Thanks for reviewing!
| llvm/lib/ObjectYAML/DWARFEmitter.cpp | ||
|---|---|---|
| 454 | Oh, thanks for pointing this out! | |
nit: you do not need curly braces around return createStringError....