<div dir="ltr"><div><div>@<span class=""><span>Georgiou, when you generate a compilation database, it's better to validate it with other tools. you can run `clang-check`, `clang-format` just to see it's valid. if it is and your tool still fails with include problems, it might be the <a href="http://clang.llvm.org/docs/LibTooling.html#builtin-includes">reason</a> mentioned in the tooling doc. the other thing i noticed, that you use relative path to the module. (instead of `</span></span><br>../ffmpeg-0.6/libavcodec/libxvid_rc.c` try `/home/andreas/Desktop/ffmpeg-0.6/libavcodec/libxvid_rc.c`)<br><br>@<span class=""><span>David, the `</span></span>build-interposition` command is already in the Clang source repo. it's in `tools/scan-build-py/bin` called `intercept-build`.<br><br><br></div>regards,<br></div>Laszlo<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 9:10 PM, Georgiou, Andreas via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div>


<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi all, </p>
<p><br>
</p>
<p>As Miklos pointed out I am using Bear to create a compilation database to analyze my source code. This lead to much better results. </p>
<p>Although I still have some problems. Does anyone knows why this happens? </p>
<p><br>
</p>
<p>When I am executing using the compilation database I get this error on certain files:</p>
<p></p>
<div>Executing ASTvisitor ../ffmpeg-0.6/libavcodec/libxvid_rc.c</div>
<div>Skipping /home/andreas/Desktop/test_analysis/../ffmpeg-0.6/libavcodec/libxvid_rc.c. Command line not found.</div>
<div><br>
</div>
<div>And does  not extract anything from the file. </div>
<div><br>
</div>
<div>When am executing myAST visitor with the exact same file but without the compilation database it gives me the error:</div>
<div>
<div> 'xvid.h' file not found</div>
<div><br>
</div>
</div>
<div>but it analyses the file and the results are mostly correct. The visitor skips enything which has to do with variable declarations of the xvid.h header. </div>
<div>"How can the command line not found" error can be fixed?</div>
<div><br>
</div>
<div>Thank you all.</div>
<br>
<p></p>
</div>
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Miklos Vajna <<a href="mailto:vmiklos@vmiklos.hu" target="_blank">vmiklos@vmiklos.hu</a>><br>
<b>Sent:</b> 12 July 2016 20:06:46<br>
<b>To:</b> David Blaikie<br>
<b>Cc:</b> Georgiou, Andreas; <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [cfe-dev] How to execute clang front-end AST visitor to exract some information from source code without compiling the source code first</font>
<div> </div>
</div>
</div><div><div class="h5">
<font size="2"><span style="font-size:10pt">
<div>Hi,<br>
<br>
On Tue, Jul 12, 2016 at 08:34:54AM -0700, David Blaikie via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
> (probably the most generic thing someone could build to help here would be<br>
> a scan-build like build-interposition tool to make a compilation database<br>
> from any project/build system. Not the most efficient, but would be handy<br>
> as a fallback)<br>
<br>
This is exactly what <<a href="https://github.com/rizsotto/Bear" target="_blank">https://github.com/rizsotto/Bear</a>> implements.<br>
<br>
Regards,<br>
<br>
Miklos<br>
</div>
</span></font>
</div></div></div>

<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>