[flang-commits] [lldb] [libcxxabi] [libunwind] [flang] [lld] [clang] [compiler-rt] [libc] [libcxx] [mlir] [polly] [llvm] [clang-tools-extra] Make clang report invalid target versions. (PR #75373)

via flang-commits flang-commits at lists.llvm.org
Mon Jan 8 14:05:39 PST 2024


================
@@ -1430,6 +1430,18 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
   const ToolChain &TC = getToolChain(
       *UArgs, computeTargetTriple(*this, TargetTriple, *UArgs));
 
+  if (TC.getTriple().isAndroid()) {
+    llvm::Triple Triple = TC.getTriple();
+    unsigned TripleVersion = Triple.getEnvironmentVersion().getMajor();
+    StringRef TripleVersionName = Triple.getEnvironmentVersionString();
+
+    if (TripleVersion == 0 && TripleVersionName != "") {
----------------
pirama-arumuga-nainar wrote:

Check for `Triple.getEnvironmentVersion().empty()` instead of `.getMajor() == 0`.  In non-Android contexts, a major version of `0` may be valid.

https://github.com/llvm/llvm-project/pull/75373


More information about the flang-commits mailing list