Clang: Change the default DWARF version to 5

(except on platforms that already opt in to specific versions - SCE,
Android, and Darwin using DWARFv4 explicitly, for instance)
This commit is contained in:
David Blaikie 2022-01-23 20:45:25 -08:00
parent b752eb887f
commit d3b26dea16
9 changed files with 20 additions and 11 deletions

View File

@ -252,6 +252,14 @@ X86 Support in Clang
- Support for ``AVX512-FP16`` instructions has been added.
DWARF Support in Clang
----------------------
- The default DWARF version has increased from DWARFv4 to DWARFv5. You can opt
back in to the old behavior with -gdwarf-4. Some platforms (Darwin, Android,
and SCE for instance) already opt out of this version bump as is suitable for
the platform
Arm and AArch64 Support in Clang
--------------------------------

View File

@ -510,7 +510,7 @@ public:
// Return the DWARF version to emit, in the absence of arguments
// to the contrary.
virtual unsigned GetDefaultDwarfVersion() const { return 4; }
virtual unsigned GetDefaultDwarfVersion() const { return 5; }
// Some toolchains may have different restrictions on the DWARF version and
// may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host

View File

@ -40,6 +40,7 @@ public:
void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
RuntimeLibType GetDefaultRuntimeLibType() const override;
unsigned GetDefaultDwarfVersion() const override;
CXXStdlibType GetDefaultCXXStdlibType() const override;
bool
IsAArch64OutlineAtomicsDefault(const llvm::opt::ArgList &Args) const override;

View File

@ -12,13 +12,13 @@
// decls so that the dwarf generator can describe information needed for tail
// call frame reconstrution.
//
// RUN: %clang -g -O2 -target x86_64-none-linux-gnu -ggdb -S -emit-llvm %s -o - \
// RUN: %clang -gdwarf-4 -O2 -target x86_64-none-linux-gnu -ggdb -S -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix=DECLS-FOR-EXTERN
//
// Do not emit a subprogram for extern decls when entry values are disabled and
// the tuning is not set to gdb.
//
// RUN: %clang -g -O2 -target x86_64-none-linux-gnu -gsce -S -emit-llvm %s -o - \
// RUN: %clang -gdwarf-4 -O2 -target x86_64-none-linux-gnu -gsce -S -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix=NO-DECLS-FOR-EXTERN
// DECLS-FOR-EXTERN-NOT: !DICompileUnit({{.*}}retainedTypes: !{{[0-9]+}}

View File

@ -2,8 +2,8 @@
// RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3
// RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
// RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
// The -isysroot is used as a hack to avoid LIT messing with the SDKROOT
// environment variable which indirecty overrides the version in the target
@ -28,10 +28,10 @@
// RUN: | FileCheck %s --check-prefixes=NODWARF,CODEVIEW
// Explicitly request DWARF.
// RUN: %clang -target i686-pc-windows-msvc -gdwarf -S -emit-llvm -o - %s \
// RUN: | FileCheck %s --check-prefixes=VER4,NOCODEVIEW
// RUN: | FileCheck %s --check-prefixes=VER5,NOCODEVIEW
// Explicitly request both.
// RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \
// RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW
// RUN: | FileCheck %s --check-prefixes=VER5,CODEVIEW
// RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
// RUN: FileCheck %s --check-prefix=VER3
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \

View File

@ -596,7 +596,7 @@
// RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
// Z7_gdwarf: "-gcodeview"
// Z7_gdwarf: "-debug-info-kind=constructor"
// Z7_gdwarf: "-dwarf-version=4"
// Z7_gdwarf: "-dwarf-version=
// RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s
// CXX11: -std=c++11

View File

@ -32,7 +32,7 @@
// CHECK-WITHOUT-G-NOT: -debug-info-kind
// CHECK-WITH-G: "-debug-info-kind=constructor"
// CHECK-WITH-G: "-dwarf-version=4"
// CHECK-WITH-G: "-dwarf-version=5"
// CHECK-WITH-G-DWARF2: "-dwarf-version=2"
// CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"

View File

@ -6,7 +6,7 @@
/// Checking dwarf-version
// RUN: %clang -### -g -target ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
// DWARF_VER: "-dwarf-version=4"
// DWARF_VER: "-dwarf-version=5"
///-----------------------------------------------------------------------------
/// Checking include-path

View File

@ -7,7 +7,7 @@
// RUN: %clangxx -### -g -target ve-unknown-linux-gnu \
// RUN: %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
// DWARF_VER: "-dwarf-version=4"
// DWARF_VER: "-dwarf-version=5"
///-----------------------------------------------------------------------------
/// Checking include-path