[PATCH] D72756: [LLD][ELF] Add support for INPUT_SECTION_FLAGS
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 19 13:51:19 PST 2020
MaskRay added inline comments.
================
Comment at: lld/ELF/ScriptParser.cpp:720
+ }
+ return readInputSectionRules(tok, withFlags, withoutFlags);
}
----------------
grimar wrote:
> I'd suggest to early return in the "INPUT_SECTION_FLAGS" branch just like we do in the "KEEP" branch.
> It seems probably a bit simpler to exit early here too?
>
> ```
> if (tok == "INPUT_SECTION_FLAGS") {
> std::tie(withFlags, withoutFlags) = readInputSectionFlags();
> return readInputSectionRules(next(), withFlags, withoutFlags);
> }
> return readInputSectionRules(tok, withFlags, withoutFlags);
> ```
`tok = next();` looks fine to me.. The return statement will become complex with the change.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72756/new/
https://reviews.llvm.org/D72756
More information about the llvm-commits
mailing list