<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p></p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
Hi all,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
I did what you said and using the same compilation database I run clang-check and the tool gave me the same error.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
Does it just trying to say that there is no "rule" for the specific file in the compilation database? </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
Furthermore something that I noticed is that some of my files are being analysed 2 times from my AST visitor and this is because of the compilation database. Is something I can do about it?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 0px; margin-bottom: 0px;">
Something for example to avoid parsing 2 times the same file?</div>
<br>
<p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Laszlo Nagy <rizsotto.mailinglist@gmail.com><br>
<b>Sent:</b> 13 July 2016 13:45:40<br>
<b>To:</b> Georgiou, Andreas<br>
<b>Cc:</b> Miklos Vajna; David Blaikie; cfe-dev@lists.llvm.org<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 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>
</div>
</body>
</html>