Skip to content

Commit c9de002

Browse files
committed
[AMDGPU][HIP] Change default DWARF version to 4
Summary: Tooling around DWARF 5 is still not mature enough for this to be a sane default, and the AMDGPU and HIP toolchains should agree on a single default. Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, aprantl, dstuttard, tpr, t-tye, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70191
1 parent 1275ab1 commit c9de002

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

clang/lib/Driver/ToolChains/AMDGPU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUToolChain : public Generic_ELF {
5555
public:
5656
AMDGPUToolChain(const Driver &D, const llvm::Triple &Triple,
5757
const llvm::opt::ArgList &Args);
58-
unsigned GetDefaultDwarfVersion() const override { return 5; }
58+
unsigned GetDefaultDwarfVersion() const override { return 4; }
5959
bool IsIntegratedAssemblerDefault() const override { return true; }
6060
bool IsMathErrnoDefault() const override { return false; }
6161

clang/lib/Driver/ToolChains/HIP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class LLVM_LIBRARY_VISIBILITY HIPToolChain : public ToolChain {
113113
computeMSVCVersion(const Driver *D,
114114
const llvm::opt::ArgList &Args) const override;
115115

116-
unsigned GetDefaultDwarfVersion() const override { return 2; }
116+
unsigned GetDefaultDwarfVersion() const override { return 4; }
117117

118118
const ToolChain &HostTC;
119119

clang/test/Driver/amdgpu-toolchain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// AS_LINK: clang{{.*}} "-cc1as"
99
// AS_LINK: ld.lld{{.*}} "-shared"
1010

11-
// DWARF_VER: "-dwarf-version=5"
11+
// DWARF_VER: "-dwarf-version=4"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// REQUIRES: clang-driver
2+
// REQUIRES: x86-registered-target
3+
// REQUIRES: amdgpu-registered-target
4+
5+
// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \
6+
// RUN: -x hip --cuda-gpu-arch=gfx803 %s \
7+
// RUN: -Xarch_gfx803 -g 2>&1 | FileCheck %s -check-prefix=DWARF_VER
8+
9+
// DWARF_VER: "-dwarf-version=4"

0 commit comments

Comments
 (0)