From 75f6a66f9a946a6839f70cf4856ceb1fb94aa6ad Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 21 Feb 2013 02:02:50 +0000 Subject: [PATCH] Respect -fno-canonical-prefixes when deciding where to generate .gcno and .gcda files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175706 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ad4fd6cd53..a63623a3be 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2292,9 +2292,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, C.getArgs().hasArg(options::OPT_S)) { if (Output.isFilename()) { CmdArgs.push_back("-coverage-file"); - SmallString<128> absFilename(Output.getFilename()); - llvm::sys::fs::make_absolute(absFilename); - CmdArgs.push_back(Args.MakeArgString(absFilename)); + if (C.getArgs().hasArg(options::OPT_no_canonical_prefixes)) { + CmdArgs.push_back(Args.MakeArgString(Output.getFilename())); + } else { + SmallString<128> absFilename(Output.getFilename()); + llvm::sys::fs::make_absolute(absFilename); + CmdArgs.push_back(Args.MakeArgString(absFilename)); + } } } -- 2.40.0