[cfe-commits] r162884 - /cfe/trunk/lib/Driver/Tools.cpp

Bill Wendling isanbard at gmail.com
Wed Aug 29 17:43:41 PDT 2012


Author: void
Date: Wed Aug 29 19:43:41 2012
New Revision: 162884

URL: http://llvm.org/viewvc/llvm-project?rev=162884&view=rev
Log:
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>

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=162884&r1=162883&r2=162884&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Aug 29 19:43:41 2012
@@ -2015,7 +2015,9 @@
       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));
     }
   }
 





More information about the cfe-commits mailing list