summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2013-01-17 21:38:06 +0000
committerKevin Enderby <enderby@apple.com>2013-01-17 21:38:06 +0000
commitae2ec4745fc102e77b45057269fe68cbe797d0b2 (patch)
treee993920fc2d60daf817b2f131d61b97ba3710c06 /clang/lib/Driver/Tools.cpp
parentbcba2b2b7507d997742eaf1aa108b91d28b84fce (diff)
downloadbcm5719-llvm-ae2ec4745fc102e77b45057269fe68cbe797d0b2.tar.gz
bcm5719-llvm-ae2ec4745fc102e77b45057269fe68cbe797d0b2.zip
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 llvm-svn: 172758
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 372af794044..3fbcd9498d1 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud