This patch helps make the PubSection optional in the DWARF structure.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM, once one comment is addressed.
llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml | ||
---|---|---|
3 | perhaps change this line to "section in object files from the DWARF entry of Mach-O YAML inputs". |
llvm/lib/ObjectYAML/MachOEmitter.cpp | ||
---|---|---|
299 | I think you should do this: ... } else if (0 == strncmp(&Sec.sectname[0], "__debug_pubnames", 16) { if (Obj.DWARF.PubNames) DWARFYAML::EmitPubSection(OS, *Obj.DWARF.PubNames, Obj.IsLittleEndian); } else .... Otherwise the code will continue doing strncmp for the following else branches, what is | |
llvm/tools/obj2yaml/dwarf2yaml.cpp | ||
149 | Thoughts (not for this patch): Looking on this, I seems it would be better to change the dumpPubSection to static DWARFYAML::PubSection dumpPubSection(DWARFContext &DCtx, DWARFSection Section, bool IsGNU); It should simplify the code here and also will allow to switch to return Expected<DWARFYAML::PubSection> later. |
I think you should do this:
Otherwise the code will continue doing strncmp for the following else branches, what is
probably not the desired flow.