From d0d8d2d572cd1db54d0f6d90f8dd3825f9c7b36b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 24 Jan 2022 14:59:54 -0800 Subject: [PATCH] [clang][Driver] use DWARF4 for wasm Opt into the old default of DWARF4 for now. Differential Revision: https://reviews.llvm.org/D118082 --- clang/lib/Driver/ToolChains/WebAssembly.h | 1 + clang/test/Driver/debug-options.c | 7 +++++++ 2 files changed, 8 insertions(+) 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 //