Always pass a -dwarf-version argument to integrated as.

This removes the default of 3 hidden in the assembler previously.

Fixes breakage caused by r249655, reported by vsukharev.

llvm-svn: 250173
This commit is contained in:
Douglas Katzman 2015-10-13 16:22:51 +00:00
parent e717a7195b
commit 722bcb08f1
3 changed files with 19 additions and 3 deletions
clang
lib/Driver
test/Driver
tools/driver

View File

@ -5632,10 +5632,11 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
if (Arg *A = Args.getLastArg(options::OPT_g_Group)) {
WantDebug = !A->getOption().matches(options::OPT_g0);
if (WantDebug) {
if ((DwarfVersion = DwarfVersionNum(A->getSpelling())) == 0)
DwarfVersion = getToolChain().GetDefaultDwarfVersion();
DwarfVersion = DwarfVersionNum(A->getSpelling());
}
}
if (DwarfVersion == 0)
DwarfVersion = getToolChain().GetDefaultDwarfVersion();
RenderDebugEnablingArgs(Args, CmdArgs,
(WantDebug ? CodeGenOptions::LimitedDebugInfo
: CodeGenOptions::NoDebugInfo),

View File

@ -0,0 +1,15 @@
@ REQUIRES: arm-registered-target
@ RUN: %clang --target=armv8a--linux-gnueabi -c %s -o %t
@ RUN: llvm-objdump -t %t | FileCheck %s
.text
.type foo,%function
foo:
.fnstart
.cfi_startproc
.Ltmp2:
.size foo, .Ltmp2-foo
.cfi_endproc
.fnend
.cfi_sections .debug_frame
@ CHECK: foo

View File

@ -144,7 +144,7 @@ public:
RelaxAll = 0;
NoExecStack = 0;
FatalWarnings = 0;
DwarfVersion = 3;
DwarfVersion = 0;
}
static bool CreateFromArgs(AssemblerInvocation &Res,