[PATCH] Don't absolutise path passed to Clang tool

Manuel Klimek klimek at google.com
Thu Apr 25 00:03:57 PDT 2013

Comment at: lib/Tooling/Tooling.cpp:246-247
@@ +245,4 @@
+    // If no command lines were found for the relative filename, try using
+    // the absolute filename.
+    if (CompileCommandsForFile.empty()) {
Manuel Klimek wrote:
> Jonathan Anderson wrote:
> > Manuel Klimek wrote:
> > > Why this change? Does the test not work without it? In which way does it fail?
> > Without this change, the relative filename gets lost between here and the FrontendAction; it looks like the FrontendAction parses the (absolute) filename from the CompileCommand rather than using CompileCommands[i].first.
> > 
> > The unit test made this problem clear. I had thought that the original change fixed my use case, but that apparent success was due to my tool picking up the wrong version of libClangTooling. :(
> > 
> > Without this change, the unit test fails with "I expected 'a.cc' but you have given me '/some/long/absolute/path/to/a.cc'".
> > 
> > All tests that rely on absolute filenames still pass, but that doesn't appear in Phabricator; how do I fix the "No unit test engine is configured for this project" message in arc?
> Did you miss this question? Or am I just too impatient ;)
But then we should fix how we hand the file name into tooling, and not use a different path to look up stuff in the compilation database, right?




More information about the cfe-commits mailing list