Author: Martin Storsjö Date: 2022-02-10T11:24:46+02:00 New Revision: 2ead82c6f972c8372f761b40fcfd7f533b632db5
URL: https://github.com/llvm/llvm-project/commit/2ead82c6f972c8372f761b40fcfd7f533b632db5 DIFF: https://github.com/llvm/llvm-project/commit/2ead82c6f972c8372f761b40fcfd7f533b632db5.diff LOG: [clang] [MinGW] Default to DWARF 4 Neither LLDB nor GDB seem to work with DWARF 5 debug information on Windows right now. This applies the same change as in 9c6272861032f511a23784ce0c5cc8f6ac2f625b (Default to DWARFv4 on Windows) to the MinGW driver too. Differential Revision: https://reviews.llvm.org/D119326 (cherry picked from commit 6cf64b2d2858dc93c3ec93438bdaca2807847e9b) Added: Modified: clang/lib/Driver/ToolChains/MinGW.h clang/test/CodeGen/dwarf-version.c Removed: ################################################################################ diff --git a/clang/lib/Driver/ToolChains/MinGW.h b/clang/lib/Driver/ToolChains/MinGW.h index c3de19b977246..c9553b4f46520 100644 --- a/clang/lib/Driver/ToolChains/MinGW.h +++ b/clang/lib/Driver/ToolChains/MinGW.h @@ -90,6 +90,8 @@ class LLVM_LIBRARY_VISIBILITY MinGW : public ToolChain { void printVerboseInfo(raw_ostream &OS) const override; + unsigned GetDefaultDwarfVersion() const override { return 4; } + protected: Tool *getTool(Action::ActionClass AC) const override; Tool *buildLinker() const override; diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c index 47025e241d13c..0a6fa4768026d 100644 --- a/clang/test/CodeGen/dwarf-version.c +++ b/clang/test/CodeGen/dwarf-version.c @@ -32,6 +32,11 @@ // Explicitly request both. // RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \ // RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW + +// Check what version of dwarf is used for MinGW targets. +// RUN: %clang -target i686-pc-windows-gnu -g -S -emit-llvm -o - %s | \ +// RUN: FileCheck %s --check-prefixes=VER4 + // 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 | \ _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits