[PATCH] D159409: Haiku: Pick up a few more codegen parametres from downstream
Brad Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 2 23:48:05 PDT 2023
brad created this revision.
brad added reviewers: nielx, korli.
brad added a project: clang.
Herald added a project: All.
brad requested review of this revision.
Herald added a subscriber: MaskRay.
Pick up a few more codegen parametres from downstream.
DWARF version 2, Math Errno handling, ObjC ABI handling, and debug handling.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D159409
Files:
clang/lib/Driver/ToolChains/Haiku.h
clang/test/CodeGen/dwarf-version.c
clang/test/Driver/clang-g-opts.c
clang/test/Driver/fast-math.c
Index: clang/test/Driver/fast-math.c
===================================================================
--- clang/test/Driver/fast-math.c
+++ 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 \
Index: clang/test/Driver/clang-g-opts.c
===================================================================
--- clang/test/Driver/clang-g-opts.c
+++ 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-DWARF2 %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,6 +29,8 @@
// 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-DWARF2 %s
// RUN: %clang -### -S %s -g0 -g --target=i386-pc-solaris 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s
Index: clang/test/CodeGen/dwarf-version.c
===================================================================
--- clang/test/CodeGen/dwarf-version.c
+++ 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=VER2
// 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
Index: clang/lib/Driver/ToolChains/Haiku.h
===================================================================
--- clang/lib/Driver/ToolChains/Haiku.h
+++ clang/lib/Driver/ToolChains/Haiku.h
@@ -22,6 +22,8 @@
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 @@
void addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
+
+ unsigned GetDefaultDwarfVersion() const override { return 2; }
+
+ bool GetDefaultStandaloneDebug() const override { return true; }
};
} // end namespace toolchains
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159409.555615.patch
Type: text/x-patch
Size: 3493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230903/99d6a8fa/attachment-0001.bin>
More information about the cfe-commits
mailing list