[cfe-commits] PATCH: Rough-cut auto-detection of a build directory location for the tooling framework

Daniel Jasper djasper at google.com
Tue Jul 10 00:40:06 PDT 2012

I have tried using it by putting a symlink to compile_commands.json into my
llvm root and then use clang-check from within <llvm root>/tools/clang like

$ clang-check lib/Tooling/CompilationDatabase.cpp
LLVM ERROR: Error while opening JSON database: No such file or directory

It works find if I supply the full path:
$ ~/clang/build/bin/clang-check $PWD/lib/Tooling/CompilationDatabase.cpp

So, it does not go up the directory tree far enough, as the
Directory.empty() will be true before my symlink  is reached. Can this be
added? And can you add a test for such a case?

  +++ tools/clang/lib/Tooling/CompilationDatabase.cpp (working copy)
  +#include "llvm/Support/raw_ostream.h"

I don't think you need this new include.

On Mon, Jul 9, 2012 at 5:49 PM, Alexander Kornienko <alexfh at google.com>wrote:

> Adds the CompilationDatabase::autoDetectFromSource method for supporting
> build directory auto-detection for simple setups.
> --
> Regards,
> Alexander
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120710/7413970a/attachment.html>

More information about the cfe-commits mailing list