[clang] 369c0e0 - [AIX] Diagnose thinLTO usage in clang on AIX.
Wael Yehia via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 19 09:40:03 PDT 2021
Author: Wael Yehia
Date: 2021-04-19T16:39:48Z
New Revision: 369c0e0f48dd3585566d251cc99955dbdeed84a1
URL: https://github.com/llvm/llvm-project/commit/369c0e0f48dd3585566d251cc99955dbdeed84a1
DIFF: https://github.com/llvm/llvm-project/commit/369c0e0f48dd3585566d251cc99955dbdeed84a1.diff
LOG: [AIX] Diagnose thinLTO usage in clang on AIX.
Reviewed By: Xiangling Liao
Differential Revision: https://reviews.llvm.org/D100350
Added:
clang/test/Driver/aix-unsupported-features.c
Modified:
clang/lib/Driver/Driver.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 39a630a7b4e8a..9a1b106673263 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3998,10 +3998,13 @@ void Driver::BuildJobs(Compilation &C) const {
}
const llvm::Triple &RawTriple = C.getDefaultToolChain().getTriple();
- if (RawTriple.isOSAIX())
+ if (RawTriple.isOSAIX()) {
if (Arg *A = C.getArgs().getLastArg(options::OPT_G))
Diag(diag::err_drv_unsupported_opt_for_target)
<< A->getSpelling() << RawTriple.str();
+ if (LTOMode == LTOK_Thin)
+ Diag(diag::err_drv_clang_unsupported) << "thinLTO on AIX";
+ }
// Collect the list of architectures.
llvm::StringSet<> ArchNames;
diff --git a/clang/test/Driver/aix-unsupported-features.c b/clang/test/Driver/aix-unsupported-features.c
new file mode 100644
index 0000000000000..0004575a223ae
--- /dev/null
+++ b/clang/test/Driver/aix-unsupported-features.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target powerpc-ibm-aix-xcoff -### -flto=thin 2>&1 %s | \
+// RUN: FileCheck --check-prefix=CHECKTHINLTO %s
+// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -flto=thin 2>&1 %s | \
+// RUN: FileCheck --check-prefix=CHECKTHINLTO %s
+
+// CHECKTHINLTO: error: the clang compiler does not support 'thinLTO on AIX'
+
More information about the cfe-commits
mailing list