Blame SOURCES/0010-PATCH-clang-Produce-DWARF4-by-default.patch

bcd7e8
From 1f68d73910ddee1beaf3582480b8a9738c941a43 Mon Sep 17 00:00:00 2001
e756a9
From: Konrad Kleine <kkleine@redhat.com>
e756a9
Date: Thu, 24 Mar 2022 09:44:21 +0100
bcd7e8
Subject: [PATCH] Produce DWARF4 by default
e756a9
e756a9
Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream:
e756a9
e756a9
https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8f5b4?diff=unified
e756a9
---
e756a9
 clang/include/clang/Driver/ToolChain.h | 2 +-
e756a9
 clang/test/CodeGen/dwarf-version.c     | 4 ++--
e756a9
 clang/test/Driver/cl-options.c         | 2 +-
bcd7e8
 clang/test/Driver/clang-g-opts.c       | 2 +-
e756a9
 clang/test/Driver/ve-toolchain.c       | 2 +-
e756a9
 clang/test/Driver/ve-toolchain.cpp     | 2 +-
bcd7e8
 6 files changed, 7 insertions(+), 7 deletions(-)
e756a9
e756a9
diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h
bcd7e8
index f20ab164531b..53c86ee82936 100644
e756a9
--- a/clang/include/clang/Driver/ToolChain.h
e756a9
+++ b/clang/include/clang/Driver/ToolChain.h
bcd7e8
@@ -535,7 +535,7 @@ public:
bcd7e8
   
e756a9
   // Return the DWARF version to emit, in the absence of arguments
e756a9
   // to the contrary.
e756a9
-  virtual unsigned GetDefaultDwarfVersion() const { return 5; }
e756a9
+  virtual unsigned GetDefaultDwarfVersion() const { return 4; }
e756a9
 
e756a9
   // Some toolchains may have different restrictions on the DWARF version and
e756a9
   // may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host
e756a9
diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c
e756a9
index 0a6fa4768026..96f01749d0d8 100644
e756a9
--- a/clang/test/CodeGen/dwarf-version.c
e756a9
+++ b/clang/test/CodeGen/dwarf-version.c
e756a9
@@ -2,8 +2,8 @@
e756a9
 // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3
e756a9
 // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
e756a9
 // RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
e756a9
-// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
e756a9
-// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
e756a9
+// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
e756a9
+// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
e756a9
 
e756a9
 // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT
e756a9
 // environment variable which indirecty overrides the version in the target
e756a9
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
bcd7e8
index a2e350a0a835..01889ba0bf9b 100644
e756a9
--- a/clang/test/Driver/cl-options.c
e756a9
+++ b/clang/test/Driver/cl-options.c
bcd7e8
@@ -570,7 +570,7 @@
e756a9
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
e756a9
 // Z7_gdwarf: "-gcodeview"
e756a9
 // Z7_gdwarf: "-debug-info-kind=constructor"
e756a9
-// Z7_gdwarf: "-dwarf-version=
e756a9
+// Z7_gdwarf: "-dwarf-version=4
e756a9
 
e756a9
 // RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s
e756a9
 // CXX11: -std=c++11
bcd7e8
diff --git a/clang/test/Driver/clang-g-opts.c b/clang/test/Driver/clang-g-opts.c
bcd7e8
index d982b1070cae..bb129e75769c 100644
bcd7e8
--- a/clang/test/Driver/clang-g-opts.c
bcd7e8
+++ b/clang/test/Driver/clang-g-opts.c
bcd7e8
@@ -32,7 +32,7 @@
bcd7e8
 
bcd7e8
 // CHECK-WITHOUT-G-NOT: -debug-info-kind
bcd7e8
 // CHECK-WITH-G: "-debug-info-kind=constructor"
bcd7e8
-// CHECK-WITH-G: "-dwarf-version=5"
bcd7e8
+// CHECK-WITH-G: "-dwarf-version=4"
bcd7e8
 // CHECK-WITH-G-DWARF2: "-dwarf-version=2"
bcd7e8
 
bcd7e8
 // CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"
e756a9
diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c
bcd7e8
index 32e25769b6da..b8a2852daba8 100644
e756a9
--- a/clang/test/Driver/ve-toolchain.c
e756a9
+++ b/clang/test/Driver/ve-toolchain.c
e756a9
@@ -6,7 +6,7 @@
e756a9
 /// Checking dwarf-version
e756a9
 
bcd7e8
 // RUN: %clang -### -g --target=ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
e756a9
-// DWARF_VER: "-dwarf-version=5"
e756a9
+// DWARF_VER: "-dwarf-version=4"
e756a9
 
e756a9
 ///-----------------------------------------------------------------------------
e756a9
 /// Checking include-path
e756a9
diff --git a/clang/test/Driver/ve-toolchain.cpp b/clang/test/Driver/ve-toolchain.cpp
bcd7e8
index 5a33d5eceb61..cedf895b36dc 100644
e756a9
--- a/clang/test/Driver/ve-toolchain.cpp
e756a9
+++ b/clang/test/Driver/ve-toolchain.cpp
e756a9
@@ -7,7 +7,7 @@
e756a9
 
bcd7e8
 // RUN: %clangxx -### -g --target=ve-unknown-linux-gnu \
e756a9
 // RUN:     %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
e756a9
-// DWARF_VER: "-dwarf-version=5"
e756a9
+// DWARF_VER: "-dwarf-version=4"
e756a9
 
e756a9
 ///-----------------------------------------------------------------------------
e756a9
 /// Checking include-path
e756a9
-- 
bcd7e8
2.37.1
e756a9