diff options
author | Joao Moreira <joao.moreira@intel.com> | 2022-04-29 14:32:48 +0800 |
---|---|---|
committer | Phoebe Wang <phoebe.wang@intel.com> | 2022-04-29 15:37:28 +0800 |
commit | db1cec371c00722ce42683e0dc8a2021186332c5 (patch) | |
tree | c5c5c57e76f550e30e4af55479ba34a2a9413d38 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | c96cc500f0b31bd881d38b2b16ee9c1fef0307e4 (diff) | |
download | llvm-db1cec371c00722ce42683e0dc8a2021186332c5.zip llvm-db1cec371c00722ce42683e0dc8a2021186332c5.tar.gz llvm-db1cec371c00722ce42683e0dc8a2021186332c5.tar.bz2 |
[X86] Fix CodeGen Module Flag for -mibt-seal
When assertions are enabled, clang will perform RoundTrip for CompilerInvocation argument generation. ibt-seal flags are currently missing in this argument generation, and because of that, the feature doesn't get enabled for these cases. Performing RoundTrip is the default for assert builds, rendering the feature broken in these scenarios.
This patch fixes this and adds a test to properly verify that modules are being generated with the flag when -mibt-seal is used.
Please, add any known relevant reviewer which I may have missed.
[1] - https://reviews.llvm.org/D116070
Reviewed By: pengfei, gftg, aaron.ballman, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D118052
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index fcb73bc..6607287 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1504,6 +1504,9 @@ void CompilerInvocation::GenerateCodeGenArgs( else if (Opts.CFProtectionBranch) GenerateArg(Args, OPT_fcf_protection_EQ, "branch", SA); + if (Opts.IBTSeal) + GenerateArg(Args, OPT_mibt_seal, SA); + for (const auto &F : Opts.LinkBitcodeFiles) { bool Builtint = F.LinkFlags == llvm::Linker::Flags::LinkOnlyNeeded && F.PropagateAttrs && F.Internalize; |