[PATCH] D65116: [Driver] Set the default win32-macho debug format to DWARF

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 14:47:04 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL366744: [Driver] Set the default win32-macho debug format to DWARF (authored by vedantk, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65116?vs=211192&id=211202#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65116/new/

https://reviews.llvm.org/D65116

Files:
  cfe/trunk/lib/Driver/ToolChains/MSVC.h
  cfe/trunk/test/Misc/win32-macho.c


Index: cfe/trunk/test/Misc/win32-macho.c
===================================================================
--- cfe/trunk/test/Misc/win32-macho.c
+++ cfe/trunk/test/Misc/win32-macho.c
@@ -1,2 +1,5 @@
 // Check that basic use of win32-macho targets works.
 // RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho %s
+
+// RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho -g %s -### 2>&1 | FileCheck %s -check-prefix=DEBUG-INFO
+// DEBUG-INFO: -dwarf-version={{.*}}
Index: cfe/trunk/lib/Driver/ToolChains/MSVC.h
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/MSVC.h
+++ cfe/trunk/lib/Driver/ToolChains/MSVC.h
@@ -78,10 +78,12 @@
   bool isPIEDefault() const override;
   bool isPICDefaultForced() const override;
 
-  /// Set CodeView as the default debug info format. Users can use -gcodeview
-  /// and -gdwarf to override the default.
+  /// Set CodeView as the default debug info format for non-MachO binary
+  /// formats, and to DWARF otherwise. Users can use -gcodeview and -gdwarf to
+  /// override the default.
   codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override {
-    return codegenoptions::DIF_CodeView;
+    return getTriple().isOSBinFormatMachO() ? codegenoptions::DIF_DWARF
+                                            : codegenoptions::DIF_CodeView;
   }
 
   /// Set the debugger tuning to "default", since we're definitely not tuning


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65116.211202.patch
Type: text/x-patch
Size: 1441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190722/10e676dc/attachment.bin>


More information about the llvm-commits mailing list