[clang] d0d8d2d - [clang][Driver] use DWARF4 for wasm
Derek Schuff via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 24 15:48:11 PST 2022
Author: Derek Schuff
Date: 2022-01-24T15:46:54-08:00
New Revision: d0d8d2d572cd1db54d0f6d90f8dd3825f9c7b36b
URL: https://github.com/llvm/llvm-project/commit/d0d8d2d572cd1db54d0f6d90f8dd3825f9c7b36b
DIFF: https://github.com/llvm/llvm-project/commit/d0d8d2d572cd1db54d0f6d90f8dd3825f9c7b36b.diff
LOG: [clang][Driver] use DWARF4 for wasm
Opt into the old default of DWARF4 for now.
Differential Revision: https://reviews.llvm.org/D118082
Added:
Modified:
clang/lib/Driver/ToolChains/WebAssembly.h
clang/test/Driver/debug-options.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/WebAssembly.h b/clang/lib/Driver/ToolChains/WebAssembly.h
index c84e596759466..b4c3082a089a0 100644
--- a/clang/lib/Driver/ToolChains/WebAssembly.h
+++ b/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -51,6 +51,7 @@ class LLVM_LIBRARY_VISIBILITY WebAssembly final : public ToolChain {
bool hasBlocksRuntime() const override;
bool SupportsProfiling() const override;
bool HasNativeLLVMSupport() const override;
+ unsigned GetDefaultDwarfVersion() const override { return 4; }
void
addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args,
diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c
index 22e05140f2618..e4a49269a8c70 100644
--- a/clang/test/Driver/debug-options.c
+++ b/clang/test/Driver/debug-options.c
@@ -132,6 +132,13 @@
// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff -gcolumn-info \
// RUN: 2>&1 | FileCheck -check-prefix=CI %s
+// WebAssembly.
+// WebAssembly should default to DWARF4.
+// RUN: %clang -### -c -g %s -target wasm32 2>&1 \
+// RUN: | FileCheck -check-prefix=G_DWARF4 %s
+// RUN: %clang -### -c -g %s -target wasm64 2>&1 \
+// RUN: | FileCheck -check-prefix=G_DWARF4 %s
+
// RUN: %clang -### -c -gdwarf-2 %s 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
//
More information about the cfe-commits
mailing list