diff options
author | Kevin Enderby <enderby@apple.com> | 2013-01-17 21:38:06 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2013-01-17 21:38:06 +0000 |
commit | 0234179282d59e6dfccc8b2da72a9a71bf5b6ac3 (patch) | |
tree | 2bf8cdfb1a86dbc90ddd81f3518396a0f4bc890d /lib/Driver/Tools.cpp | |
parent | 17d481fb97b304a58e45a136e3f3e2a2a22b76c8 (diff) |
We want the dwarf AT_producer for assembly source files to match clang's
AT_producer. Which includes clang's version information so we can tell
which version of the compiler was used.
This is second of the two steps to allow us to do this. The first was a
change to llvm-mc with revision 172630 to provide a method to set the
AT_producer string. This second step has the clang driver passing the value
of getClangFullVersion() via the new flag -dwarf-debug-producer when invoking
the integrated assembler on assembly source files. Then using the new
setDwarfDebugProducer() method to set the AT_producer string.
rdar://12888242
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 372af79404..3fbcd9498d 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -12,6 +12,7 @@ #include "SanitizerArgs.h" #include "ToolChains.h" #include "clang/Basic/ObjCRuntime.h" +#include "clang/Basic/Version.h" #include "clang/Driver/Action.h" #include "clang/Driver/Arg.h" #include "clang/Driver/ArgList.h" @@ -3341,6 +3342,11 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, // Add the -fdebug-compilation-dir flag if needed. addDebugCompDirArg(Args, CmdArgs); + + // Set the AT_producer to the clang version when using the integrated + // assembler on assembly source files. + CmdArgs.push_back("-dwarf-debug-producer"); + CmdArgs.push_back(Args.MakeArgString(getClangFullVersion())); } // Optionally embed the -cc1as level arguments into the debug info, for build |