Skip to content

Commit 3832629

Browse files
committed
[clang][cli] NFC: Add PIE parsing for precompiled input and IR
This patch effectively reverts a small part of D83979. When we stop parsing `LangOpts` unconditionally in `parseSimpleArgs` (above the diff) and move them back to `ParseLangArgs` (called in `else` branch) in D94682, `LangOpts.PIE` would never get parsed in this `if` branch. This patch ensures this doesn't happen. Right now, this causes `LangOpts.PIE` to be parsed twice, but that will be immediately corrected in D94682. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D94679
1 parent bf1aa5d commit 3832629

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,6 +2970,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
29702970
// PIClevel and PIELevel are needed during code generation and this should be
29712971
// set regardless of the input type.
29722972
LangOpts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
2973+
LangOpts.PIE = Args.hasArg(OPT_pic_is_pie);
29732974
parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ),
29742975
Diags, LangOpts.Sanitize);
29752976
} else {

0 commit comments

Comments
 (0)