aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-08-30 00:43:41 +0000
committerBill Wendling <isanbard@gmail.com>2012-08-30 00:43:41 +0000
commitecbbea47659c13ef4193879001f606868757007e (patch)
tree0d4da1dbcd5ef7d4ffc3aa600d46cce54f01fb25
parent9757377ba280c48c7de55de2e04dbad3b7df38e6 (diff)
Emit .gcda files as absolute paths instead of relative paths.
This improves compatibility with gcc in this regard, and this file generation can be ameliorated with GCOV_PREFIX and GCOV_PREFIX_STRIP. It's also useful if your build directory doesn't specify -o <abspath> and it uses a recursive make structure, so it's not relative to the toplevel. Patch by Joshua Cranmer! <rdar://problem/12179524> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162884 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/Tools.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 4336d9ee26..c113406670 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2015,7 +2015,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
C.getArgs().hasArg(options::OPT_S)) {
if (Output.isFilename()) {
CmdArgs.push_back("-coverage-file");
- CmdArgs.push_back(Args.MakeArgString(Output.getFilename()));
+ SmallString<128> absFilename(Output.getFilename());
+ llvm::sys::fs::make_absolute(absFilename);
+ CmdArgs.push_back(Args.MakeArgString(absFilename));
}
}