forked from OSchip/llvm-project
parent
0f62c8d8f8
commit
670c62770e
|
@ -3146,10 +3146,11 @@ 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, OpenBSD and FreeBSD.
|
||||
// Default is dwarf-2 for Darwin, OpenBSD, FreeBSD and Solaris.
|
||||
const llvm::Triple &Triple = getToolChain().getTriple();
|
||||
if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::OpenBSD ||
|
||||
Triple.getOS() == llvm::Triple::FreeBSD)
|
||||
Triple.getOS() == llvm::Triple::FreeBSD ||
|
||||
Triple.getOS() == llvm::Triple::Solaris)
|
||||
CmdArgs.push_back("-gdwarf-2");
|
||||
} else if (A->getOption().matches(options::OPT_gdwarf_2))
|
||||
CmdArgs.push_back("-gdwarf-2");
|
||||
|
@ -3159,10 +3160,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
CmdArgs.push_back("-gdwarf-4");
|
||||
else if (!A->getOption().matches(options::OPT_g0) &&
|
||||
!A->getOption().matches(options::OPT_ggdb0)) {
|
||||
// Default is dwarf-2 for Darwin, OpenBSD and FreeBSD.
|
||||
// Default is dwarf-2 for Darwin, OpenBSD, FreeBSD and Solaris.
|
||||
const llvm::Triple &Triple = getToolChain().getTriple();
|
||||
if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::OpenBSD ||
|
||||
Triple.getOS() == llvm::Triple::FreeBSD)
|
||||
Triple.getOS() == llvm::Triple::FreeBSD ||
|
||||
Triple.getOS() == llvm::Triple::Solaris)
|
||||
CmdArgs.push_back("-gdwarf-2");
|
||||
else
|
||||
CmdArgs.push_back("-g");
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// RUN: %clang -target x86_64-apple-darwin -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
|
||||
// RUN: %clang -target powerpc-unknown-openbsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
|
||||
// RUN: %clang -target powerpc-unknown-freebsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
|
||||
// RUN: %clang -target i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
|
||||
int main (void) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
|
||||
// RUN: %clang -### -S %s -g0 -g -target x86_64-pc-freebsd10.0 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
|
||||
// RUN: %clang -### -S %s -g0 -g -target i386-pc-solaris 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
|
||||
|
||||
// CHECK-WITHOUT-G-NOT: "-g"
|
||||
// CHECK-WITH-G: "-g"
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
||||
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
||||
// RUN: %clang -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
|
||||
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=GLTO_NO %s
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue