This is a NFC patch to change the input parameter of the method SectionRef::isDebugSection(), by replacing the StringRef SectionName with DataRefImpl Sec. This allows us to determine if a section is debug type in more ways than just by section name.
Details
- Reviewers
djtodoro jhenderson aprantl shchenz - Group Reviewers
Restricted Project - Commits
- rGbf809cd165f4: [NFC][object] Change the input parameter of the method isDebugSection.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
You added implementation of XCOFFObjectFile::isDebugSection, which does not exist before your patch (besides, its implementation is not as 'trivial' as others). Are you sure this is an NFC?
I understand your concern, hmm..., I will move this part to the child revision D102603 where this method is really used. Thanks!
llvm/lib/Object/MachOObjectFile.cpp | ||
---|---|---|
2049 | I recognise that this is the common pattern used elsewhere in this file, but if I'm not mistaken, it can lead to an unhandled Error should getSectionName ever fail, which is an assertion when certain options are enabled. At the very least, there needs to be a consumeError(SectionNameOrErr.takeError()) line after the if, with a TODO saying to report the error message properly. If you can prove that getSectionName(Sec) never returns an error, you can use cantFail and avoid the TODO instead. Same applies to each of the other formats. | |
llvm/lib/Object/ObjectFile.cpp | ||
96–97 | Nit: clang-format as directed. |
llvm/lib/Object/COFFObjectFile.cpp | ||
---|---|---|
335 | You need to return after this consumeError, as you can't safely retrieve the name from a failed Expected. Same applies in the other file formats. |
You need to return after this consumeError, as you can't safely retrieve the name from a failed Expected. Same applies in the other file formats.