<div>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 this:</div><div><br></div><div>$ clang-check lib/Tooling/CompilationDatabase.cpp<br>
</div><div><div>LLVM ERROR: Error while opening JSON database: No such file or directory</div></div><div><br></div><div>It works find if I supply the full path:</div><div><div>$ ~/clang/build/bin/clang-check $PWD/lib/Tooling/CompilationDatabase.cpp </div>
<div>Processing: /home/djasper/clang/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp.</div></div><div><br></div><div>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?</div>
<div><br></div><div>  +++ tools/clang/lib/Tooling/CompilationDatabase.cpp<span style="white-space:pre-wrap">    </span>(working copy)<br></div>
<div>  ...</div><div>  +#include "llvm/Support/raw_ostream.h"</div>
<div><br></div><div>I don't think you need this new include.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 9, 2012 at 5:49 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Adds the CompilationDatabase::autoDetectFromSource method for supporting build directory auto-detection for simple setups.<span class="HOEnZb"><font color="#888888"><br clear="all">
<div><br></div>-- <br>
<div>Regards,</div><div>Alexander</div>
</font></span><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>