]> granicus.if.org Git - clang/commitdiff
[Driver] Quote clang full version in dwarf producer when invoking cc1as
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 30 Mar 2016 00:25:57 +0000 (00:25 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 30 Mar 2016 00:25:57 +0000 (00:25 +0000)
Convenience to allow easy copy-n-paste from clang -v output when
reproducing cc1as comandline.

rdar://problem/23959295

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264813 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Misc/cc1as-asm.s

index a64961c31523008a049571b73d8db6e2015a974f..b441c72f03f6404b6cd5b23abc5be38f828fe5b5 100644 (file)
@@ -6226,7 +6226,8 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
     // 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()));
+    std::string QuotedClangVersion("'" + getClangFullVersion() + "'");
+    CmdArgs.push_back(Args.MakeArgString(QuotedClangVersion));
 
     // And pass along -I options
     Args.AddAllArgs(CmdArgs, options::OPT_I);
index af92644073ac9ab4174c4feb2b29804b7b2c6c86..36549c020e17177c6e0bd33018eaf9bb1dff6642 100644 (file)
@@ -1,3 +1,5 @@
 // Run cc1as asm output path just to make sure it works
 // REQUIRES: x86-registered-target
 // RUN: %clang -cc1as -triple x86_64-apple-macosx10.10.0 -filetype asm %s -o /dev/null
+// Test that cc1as is able to consume a quoted clang full version
+// RUN: %clang -cc1as -triple x86_64-apple-macosx10.10.0 -dwarf-debug-producer 'clang dummy version' -filetype asm %s -o /dev/null