[PATCH] D81356: [ObjectYAML] Add support for error handling in DWARFYAML. NFC.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 03:46:46 PDT 2020
grimar added inline comments.
================
Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:862
+ } else
llvm_unreachable("unexpected emitDWARF() call");
----------------
My concern this starts to look a bit bulky. Perhaps something like the following would be better?
```
uint64_t BeginOffset = OS.tell();
Error Err = Error::success();
if (Name == ".debug_str")
Err = DWARFYAML::EmitDebugStr(OS, DWARF);
else if (Name == ".debug_aranges")
Err = DWARFYAML::EmitDebugAranges(OS, DWARF);
...
if (Err)
return std::move(Err);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81356/new/
https://reviews.llvm.org/D81356
More information about the llvm-commits
mailing list