File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,12 @@ class LLVM_LIBRARY_VISIBILITY MSVCToolChain : public ToolChain {
7878 bool isPIEDefault () const override ;
7979 bool isPICDefaultForced () const override ;
8080
81- // / Set CodeView as the default debug info format. Users can use -gcodeview
82- // / and -gdwarf to override the default.
81+ // / Set CodeView as the default debug info format for non-MachO binary
82+ // / formats, and to DWARF otherwise. Users can use -gcodeview and -gdwarf to
83+ // / override the default.
8384 codegenoptions::DebugInfoFormat getDefaultDebugFormat () const override {
84- return codegenoptions::DIF_CodeView;
85+ return getTriple ().isOSBinFormatMachO () ? codegenoptions::DIF_DWARF
86+ : codegenoptions::DIF_CodeView;
8587 }
8688
8789 // / Set the debugger tuning to "default", since we're definitely not tuning
Original file line number Diff line number Diff line change 11// Check that basic use of win32-macho targets works.
22// RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho %s
3+
4+ // RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho -g %s -### 2>&1 | FileCheck %s -check-prefix=DEBUG-INFO
5+ // DEBUG-INFO: -dwarf-version={{.*}}
You can’t perform that action at this time.
0 commit comments