[clang] b70f1f8 - Haiku: Pick up a few more codegen parametres from downstream
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 4 00:06:09 PDT 2023
Author: X512
Date: 2023-09-04T03:05:51-04:00
New Revision: b70f1f836da9b66675db74d19c84bddd0f6708a8
URL: https://github.com/llvm/llvm-project/commit/b70f1f836da9b66675db74d19c84bddd0f6708a8
DIFF: https://github.com/llvm/llvm-project/commit/b70f1f836da9b66675db74d19c84bddd0f6708a8.diff
LOG: Haiku: Pick up a few more codegen parametres from downstream
Pick up a few more codegen parametres from downstream. The DWARF version matchesthe GCC config.
DWARF version 4, Math Errno handling, ObjC ABI handling, and debug handling.
Reviewed By: nielx
Differential Revision: https://reviews.llvm.org/D159409
Added:
Modified:
clang/lib/Driver/ToolChains/Haiku.h
clang/test/CodeGen/dwarf-version.c
clang/test/Driver/clang-g-opts.c
clang/test/Driver/debug-options.c
clang/test/Driver/fast-math.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Haiku.h b/clang/lib/Driver/ToolChains/Haiku.h
index cc7f7eb19091a97..4b5f21f7ba66bec 100644
--- a/clang/lib/Driver/ToolChains/Haiku.h
+++ b/clang/lib/Driver/ToolChains/Haiku.h
@@ -22,6 +22,8 @@ class LLVM_LIBRARY_VISIBILITY Haiku : public Generic_ELF {
Haiku(const Driver &D, const llvm::Triple &Triple,
const llvm::opt::ArgList &Args);
+ bool IsMathErrnoDefault() const override { return false; }
+ bool IsObjCNonFragileABIDefault() const override { return true; }
bool isPICDefault() const override { return true; }
void AddClangSystemIncludeArgs(
@@ -33,6 +35,10 @@ class LLVM_LIBRARY_VISIBILITY Haiku : public Generic_ELF {
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
+
+ unsigned GetDefaultDwarfVersion() const override { return 4; }
+
+ bool GetDefaultStandaloneDebug() const override { return true; }
};
} // end namespace toolchains
diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c
index 850cedf4d14c76e..e63316ace69c872 100644
--- a/clang/test/CodeGen/dwarf-version.c
+++ b/clang/test/CodeGen/dwarf-version.c
@@ -14,6 +14,7 @@
// RUN: %clang -target x86_64-apple-darwin14 -g -S -emit-llvm -o - %s -isysroot %t | FileCheck %s --check-prefix=VER2
// RUN: %clang -target powerpc-unknown-openbsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
+// RUN: %clang --target=x86_64-unknown-haiku -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
// RUN: %clang -target powerpc-unknown-freebsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
// Check which debug info formats we use on Windows. By default, in an MSVC
diff --git a/clang/test/Driver/clang-g-opts.c b/clang/test/Driver/clang-g-opts.c
index 4882eb6068f4360..b1cdf411925aea1 100644
--- a/clang/test/Driver/clang-g-opts.c
+++ b/clang/test/Driver/clang-g-opts.c
@@ -9,6 +9,8 @@
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
// RUN: %clang -### -S %s -g -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
+// RUN: %clang -### -S %s -g --target=x86_64-unknown-haiku 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF4 %s
// 'g0' is the default. Just basic correctness check that it does nothing
// RUN: %clang -### -S %s -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
@@ -27,12 +29,15 @@
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
// RUN: %clang -### -S %s -g0 -g -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
+// RUN: %clang -### -S %s -g0 -g --target=x86_64-unknown-haiku 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF4 %s
// RUN: %clang -### -S %s -g0 -g --target=i386-pc-solaris 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s
// CHECK-WITHOUT-G-NOT: -debug-info-kind
// CHECK-WITH-G: "-debug-info-kind=constructor"
// CHECK-WITH-G: "-dwarf-version=5"
+// CHECK-WITH-G-DWARF4: "-dwarf-version=4"
// CHECK-WITH-G-DWARF2: "-dwarf-version=2"
// CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"
diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c
index 8ffa88d00dff376..6c472f047528d37 100644
--- a/clang/test/Driver/debug-options.c
+++ b/clang/test/Driver/debug-options.c
@@ -83,6 +83,11 @@
// RUN: | FileCheck -check-prefix=G_GDB \
// RUN: -check-prefix=G_DWARF4 %s
+// Haiku.
+// RUN: %clang -### -c -g %s --target=x86_64-unknown-haiku 2>&1 \
+// RUN: | FileCheck -check-prefix=G_STANDALONE \
+// RUN: -check-prefix=G_DWARF4 %s
+
// Windows.
// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \
// RUN: | FileCheck -check-prefix=G_GDB %s
diff --git a/clang/test/Driver/fast-math.c b/clang/test/Driver/fast-math.c
index 34b9899e9fc185e..882e81fd14d34a7 100644
--- a/clang/test/Driver/fast-math.c
+++ b/clang/test/Driver/fast-math.c
@@ -122,6 +122,8 @@
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target x86_64-unknown-openbsd -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
+// RUN: %clang -### --target=x86_64-unknown-haiku -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target x86_64-unknown-dragonfly -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
// RUN: %clang -### -target x86_64-fuchsia -c %s 2>&1 \
More information about the cfe-commits
mailing list