aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Paoliello <danpao@microsoft.com>2025-01-30 09:51:43 -0800
committerGitHub <noreply@github.com>2025-01-30 09:51:43 -0800
commit845cc968e987492bda6a62c9a87cd96cfc631d5b (patch)
tree2f545e6fe1f5a8e442b8e5a5efe6a9a26614953b /clang/lib/CodeGen/CodeGenModule.cpp
parent0e43b9547d56762d29de9a99c998e7939417a1f3 (diff)
downloadllvm-845cc968e987492bda6a62c9a87cd96cfc631d5b.zip
llvm-845cc968e987492bda6a62c9a87cd96cfc631d5b.tar.gz
llvm-845cc968e987492bda6a62c9a87cd96cfc631d5b.tar.bz2
[clang][llvm][aarch64][win] Add a clang flag and module attribute for import call optimization, and remove LLVM flag (#122831)
Switches import call optimization from being enabled by an LLVM flag to instead using a module attribute, and creates a new Clang flag that will set that attribute. This addresses the concern raised in the original PR: <https://github.com/llvm/llvm-project/pull/121516#discussion_r1911763991> This change also only creates the Called Global info if the module attribute is present, addressing this concern: <https://github.com/llvm/llvm-project/pull/122762#pullrequestreview-2547595934>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a015d64..05879cd 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1293,6 +1293,11 @@ void CodeGenModule::Release() {
if (LangOpts.EHAsynch)
getModule().addModuleFlag(llvm::Module::Warning, "eh-asynch", 1);
+ // Emit Import Call section.
+ if (CodeGenOpts.ImportCallOptimization)
+ getModule().addModuleFlag(llvm::Module::Warning, "import-call-optimization",
+ 1);
+
// Indicate whether this Module was compiled with -fopenmp
if (getLangOpts().OpenMP && !getLangOpts().OpenMPSimd)
getModule().addModuleFlag(llvm::Module::Max, "openmp", LangOpts.OpenMP);