summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/cc1as_main.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/tools/driver/cc1as_main.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/tools/driver/cc1as_main.cpp')
-rw-r--r--clang/tools/driver/cc1as_main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp
index 6f1c8afaa2f..726af19af6c 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/tools/driver/cc1as_main.cpp
@@ -83,6 +83,7 @@ struct AssemblerInvocation {
unsigned SaveTemporaryLabels : 1;
unsigned GenDwarfForAssembly : 1;
std::string DwarfDebugFlags;
+ std::string DwarfDebugProducer;
std::string DebugCompilationDir;
std::string MainFileName;
@@ -183,6 +184,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
Opts.SaveTemporaryLabels = Args->hasArg(OPT_L);
Opts.GenDwarfForAssembly = Args->hasArg(OPT_g);
Opts.DwarfDebugFlags = Args->getLastArgValue(OPT_dwarf_debug_flags);
+ Opts.DwarfDebugProducer = Args->getLastArgValue(OPT_dwarf_debug_producer);
Opts.DebugCompilationDir = Args->getLastArgValue(OPT_fdebug_compilation_dir);
Opts.MainFileName = Args->getLastArgValue(OPT_main_file_name);
@@ -309,6 +311,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
Ctx.setGenDwarfForAssembly(true);
if (!Opts.DwarfDebugFlags.empty())
Ctx.setDwarfDebugFlags(StringRef(Opts.DwarfDebugFlags));
+ if (!Opts.DwarfDebugProducer.empty())
+ Ctx.setDwarfDebugProducer(StringRef(Opts.DwarfDebugProducer));
if (!Opts.DebugCompilationDir.empty())
Ctx.setCompilationDir(Opts.DebugCompilationDir);
if (!Opts.MainFileName.empty())
OpenPOWER on IntegriCloud