From: Douglas Katzman Date: Tue, 13 Oct 2015 16:22:51 +0000 (+0000) Subject: Always pass a -dwarf-version argument to integrated as. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96497ca976174c33cca52f7e8292dd08bf9830fc;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250173 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 999231a278..8a8904dd81 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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), diff --git a/test/Driver/as-default-dwarf.s b/test/Driver/as-default-dwarf.s new file mode 100644 index 0000000000..9988203c14 --- /dev/null +++ b/test/Driver/as-default-dwarf.s @@ -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 diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index 54a77ed40e..d98ba6ea42 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -144,7 +144,7 @@ public: RelaxAll = 0; NoExecStack = 0; FatalWarnings = 0; - DwarfVersion = 3; + DwarfVersion = 0; } static bool CreateFromArgs(AssemblerInvocation &Res,