Blame SOURCES/0008-Produce-DWARF4-by-default.patch

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