<html>
<head></head>
<body>
<p>Hello everyone,</p>
<p>To get started with Clang, I'm trying to reproduce the examles in tutorial. I began with:</p>
<p><a href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchersTutorial.html</a></p>
<p>I accomplished Step 0 and 1 without any problems, but I had trouble with Step 2.<br/>
1. The directory ~/clang-llvm/llvm/llvm_build doesn't exist. So, I tried to rerun ninja in ~/clang-llvm/build as I did in Step 1, but it says: "ninja: no work to do"<br/>
How can I recompile LoopConvert?</p>
<p>2. If I run now bin/loop-convert test.cpp as in Step1, it says:<br/>
LLVM ERROR: Could not auto-detect compilation database for file "test.cpp"<br />No compilation database found in /home/pedro/clang-llvm/build or any parent directory<br />json-compilation-database: Error while opening JSON database: No such file or directory<br /><br />What's the problem now? What have changed?</p>
<p>After this, I tried to follow this other tutorial:<br/>
ttp://clang.llvm.org/docs/RAVFrontendAction.html</p>
<p>As in Step1, I put FindClassDecls.cpp in a directory called find-class-decls in ~/clang-llvm/llvm/tools/clang/tools andc hanged the CMakeLists.txt in tools. Then, I run ninja in ~/clang-llvm/build and I get the next error:</p>
<blockquote class="replyBlock" style="border-left: 2px solid #000083; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>/home/pedro/clang-llvm/llvm/tools/clang/tools/find-class-decls/FindClassDecls.cpp:17:43: error: member access into incomplete type 'clang::ASTContext'<br />      FullSourceLoc FullLocation = Context->getFullLoc(Declaration->getLocStart());<br />                                          ^<br />/home/pedro/clang-llvm/llvm/tools/clang/include/clang/AST/ASTConsumer.h:18:9: note: forward declaration of 'clang::ASTContext'<br />  class ASTContext;<br />        ^<br />/home/pedro/clang-llvm/llvm/tools/clang/tools/find-class-decls/FindClassDecls.cpp:36:33: error: member access into incomplete type 'clang::ASTContext'<br />    Visitor.TraverseDecl(Context.getTranslationUnitDecl());<br />                                ^<br />/home/pedro/clang-llvm/llvm/tools/clang/include/clang/AST/ASTConsumer.h:18:9: note: forward declaration of 'clang::ASTContext'<br />  class ASTContext;<br />        ^<br />2 errors generated.</p>
</blockquote><br/>
<br/>
<p>What's happening here?</p>
<br/>
<p>Thanks in advance.</p>
<p>Pedro.</p>
<p>PD; By the way, LoopPrinter class in <a href="http://clang.llvm.org/docs/LibASTMatchersTutorial.html" target="_blank">http://clang.llvm.org/docs/LibASTMatchersTutorial.html</a> lacks a '}' before '};'</p>
</body>
</html>