From 6484b95d634f53dd929c75265ef3c4decf397584 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Wed, 30 Mar 2016 00:25:57 +0000 Subject: [PATCH] [Driver] Quote clang full version in dwarf producer when invoking cc1as 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 | 3 ++- test/Misc/cc1as-asm.s | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index a64961c315..b441c72f03 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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); diff --git a/test/Misc/cc1as-asm.s b/test/Misc/cc1as-asm.s index af92644073..36549c020e 100644 --- a/test/Misc/cc1as-asm.s +++ b/test/Misc/cc1as-asm.s @@ -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 -- 2.40.0