forked from OSchip/llvm-project
Revert "Debug info: Make DWARF4 the default for Darwin, too."
I'm holding this change to give maintainers of Darwin buildbots more time to update their toolchains. This reverts commit r201375. llvm-svn: 201520
This commit is contained in:
parent
f275d09a34
commit
549c514799
|
@ -2660,6 +2660,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
// FIXME: we should support specifying dwarf version with
|
||||
// -gline-tables-only.
|
||||
CmdArgs.push_back("-gline-tables-only");
|
||||
// Default is dwarf-2 for darwin.
|
||||
if (getToolChain().getTriple().isOSDarwin())
|
||||
CmdArgs.push_back("-gdwarf-2");
|
||||
} else if (A->getOption().matches(options::OPT_gdwarf_2))
|
||||
CmdArgs.push_back("-gdwarf-2");
|
||||
else if (A->getOption().matches(options::OPT_gdwarf_3))
|
||||
|
@ -2667,9 +2670,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
else if (A->getOption().matches(options::OPT_gdwarf_4))
|
||||
CmdArgs.push_back("-gdwarf-4");
|
||||
else if (!A->getOption().matches(options::OPT_g0) &&
|
||||
!A->getOption().matches(options::OPT_ggdb0))
|
||||
!A->getOption().matches(options::OPT_ggdb0)) {
|
||||
// Default is dwarf-2 for darwin.
|
||||
if (getToolChain().getTriple().isOSDarwin())
|
||||
CmdArgs.push_back("-gdwarf-2");
|
||||
else
|
||||
CmdArgs.push_back("-g");
|
||||
}
|
||||
}
|
||||
|
||||
// We ignore flags -gstrict-dwarf and -grecord-gcc-switches for now.
|
||||
Args.ClaimAllArgs(options::OPT_g_flags_Group);
|
||||
|
|
|
@ -11,4 +11,4 @@ int main (void) {
|
|||
// VER3: metadata !{i32 2, metadata !"Dwarf Version", i32 3}
|
||||
// VER4: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
|
||||
// LINUX: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
|
||||
// DARWIN: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
|
||||
// DARWIN: metadata !{i32 2, metadata !"Dwarf Version", i32 2}
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
|
||||
// CHECK-WITHOUT-G-NOT: "-g"
|
||||
// CHECK-WITH-G: "-g"
|
||||
// CHECK-WITH-G-DARWIN: "-g"
|
||||
// CHECK-WITH-G-DARWIN: "-gdwarf-2"
|
||||
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
// RUN: %clang -### -c -gline-tables-only %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
||||
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
|
||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DARWIN %s
|
||||
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=G_ONLY %s
|
||||
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=G_ONLY %s
|
||||
// RUN: | FileCheck -check-prefix=G_ONLY_DARWIN %s
|
||||
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=GLTO_NO %s
|
||||
//
|
||||
|
@ -76,11 +76,22 @@
|
|||
// GLTO_ONLY: "-gline-tables-only"
|
||||
// GLTO_ONLY-NOT: "-g"
|
||||
//
|
||||
// GLTO_ONLY_DARWIN: "-cc1"
|
||||
// GLTO_ONLY_DARWIN-NOT: "-g"
|
||||
// GLTO_ONLY_DARWIN: "-gline-tables-only"
|
||||
// GLTO_ONLY_DARWIN: "-gdwarf-2"
|
||||
// GLTO_ONLY_DARWIN-NOT: "-g"
|
||||
//
|
||||
// G_ONLY: "-cc1"
|
||||
// G_ONLY-NOT: "-gline-tables-only"
|
||||
// G_ONLY: "-g"
|
||||
// G_ONLY-NOT: "-gline-tables-only"
|
||||
//
|
||||
// G_ONLY_DARWIN: "-cc1"
|
||||
// G_ONLY_DARWIN-NOT: "-gline-tables-only"
|
||||
// G_ONLY_DARWIN: "-gdwarf-2"
|
||||
// G_ONLY_DARWIN-NOT: "-gline-tables-only"
|
||||
//
|
||||
// GLTO_NO: "-cc1"
|
||||
// GLTO_NO-NOT: "-gline-tables-only"
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue