diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2021-01-15 15:42:29 +0100 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2021-01-15 16:41:34 +0100 |
commit | 383262933045e1c138362105be4ee4d1b62ab4cc (patch) | |
tree | bdd0fc21c10d9360c787ffe0ce247ec5e9e34100 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | bf1aa5db5c76d187df8dfef28bc5b8889fb53c4b (diff) | |
download | llvm-383262933045e1c138362105be4ee4d1b62ab4cc.zip llvm-383262933045e1c138362105be4ee4d1b62ab4cc.tar.gz llvm-383262933045e1c138362105be4ee4d1b62ab4cc.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c85b0f9..d261eb7 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2970,6 +2970,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, // PIClevel and PIELevel are needed during code generation and this should be // set regardless of the input type. LangOpts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags); + LangOpts.PIE = Args.hasArg(OPT_pic_is_pie); parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ), Diags, LangOpts.Sanitize); } else { |