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.
djtodoro jhenderson aprantl shchenz
- Group Reviewers
- rGbf809cd165f4: [NFC][object] Change the input parameter of the method isDebugSection.
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 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.
Nit: clang-format as directed.