[clang] [clang] add llvm abi support (PR #121123)

Tristan Ross via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 26 09:37:02 PST 2024


https://github.com/RossComputerGuy updated https://github.com/llvm/llvm-project/pull/121123

>From f5ef9c9fc9aac6058f5dd070f9e24932b4e4cf9a Mon Sep 17 00:00:00 2001
From: Tristan Ross <tristan.ross at midstall.com>
Date: Wed, 25 Dec 2024 14:38:30 -0800
Subject: [PATCH] [clang] add llvm abi support

---
 clang/lib/Driver/Driver.cpp           |  2 +-
 clang/test/Driver/invalid-version.cpp | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index dc84c1b9d1cc4e..98b8e6e97419c6 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1531,7 +1531,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
 
   // Check if the environment version is valid except wasm case.
   llvm::Triple Triple = TC.getTriple();
-  if (!Triple.isWasm()) {
+  if (!Triple.isWasm() && Triple.getEnvironment() != llvm::Triple::LLVM) {
     StringRef TripleVersionName = Triple.getEnvironmentVersionString();
     StringRef TripleObjectFormat =
         Triple.getObjectFormatTypeName(Triple.getObjectFormat());
diff --git a/clang/test/Driver/invalid-version.cpp b/clang/test/Driver/invalid-version.cpp
index 6a4702a9b66b0f..15ba8a9616f86d 100644
--- a/clang/test/Driver/invalid-version.cpp
+++ b/clang/test/Driver/invalid-version.cpp
@@ -29,3 +29,13 @@
 // RUN:   FileCheck --check-prefix=CHECK-WASM1 %s
 
 // CHECK-WASM1: "-triple" "wasm32-unknown-wasi-pthread"
+
+// RUN: %clang --target=aarch64-unknown-linux-llvm -c %s -### 2>&1 | \
+// RUN:   FileCheck --check-prefix=CHECK-AARCH64-LLVM %s
+
+// CHECK-AARCH64-LLVM: "-triple" "aarch64-unknown-linux-llvm"
+
+// RUN: %clang --target=x86_64-unknown-linux-llvm -c %s -### 2>&1 | \
+// RUN:   FileCheck --check-prefix=CHECK-X86-64-LLVM %s
+
+// CHECK-X86-64-LLVM: "-triple" "x86_64-unknown-linux-llvm"



More information about the cfe-commits mailing list