<div dir="ltr">I am working with clang version 3.8. I have a MPI program which is causing the problem. Version 4.9.3 of mpiCC. I guess you will be able to reproduce the problem with a simple mpi program. <div><br></div><div>Also, I use this compile_commands.json file:</div><div><div>[</div><div>{</div><div>  "directory": "~/Dropbox/CLANG_MPI_LLVM/MPI"<wbr>,</div><div>  "command": "mpiCC -I/usr/include/mpi BasicMPIProgram.cpp",</div><div>  "file": "~/Dropbox/CLANG_MPI_LLVM/MPI/<wbr>BasicMPIProgram.cpp"</div><div>}</div><div>]</div></div><div><br></div><div>And this to run the clang tool on a mpi source file: ./tool -p ~/Dropbox/CLANG_MPI_LLVM/MPI BasicMPIProgram.cpp</div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 12:52 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span>On Sun, Aug 7, 2016 at 9:06 AM, Dhriti Khanna via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
> Hello,<br>
><br>
> I want to print the arguments passed to a function. But clang returns<br>
> Parameter names used in the function definition. Here is my code:<br>
><br>
> if (CallExpr *call = dyn_cast<CallExpr>(st))<br>
> {<br>
>     LangOptions LangOpts;<br>
>     LangOpts.CPlusPlus = true;<br>
>     PrintingPolicy Policy(LangOpts);<br>
><br>
>     for(int i=0, j=call->getNumArgs(); i<j; i++)<br>
>     {<br>
>         std::string TypeS;<br>
>         raw_string_ostream raw(TypeS);<br>
>         call->getArg(i)->printPretty(<wbr>raw, 0, Policy);<br>
>         errs() << raw.str() << "\n";<br>
>     }<br>
> }<br>
> Example:<br>
> int iArgument = 123;<br>
> char cArgument = 'c';<br>
> foo(iArgument, cArgument);<br>
> For this code, it should print iArgument and cArgument, but it is printing<br>
> the names of the parameters given in function definition.<br>
><br>
> Please tell what might be the problem.<br>
<br>
</span>I cannot reproduce this issue. Are you testing with ToT, or some other<br>
version of Clang?<br>
<span><br>
> Also, I am able to get the arguments' name when I am using a simple C++<br>
> code. But when I start using another library's API (for that I am specifying<br>
> compile_commands.json file), this presents problems.<br>
<br>
</span>Can you give some steps to reproduce? Is it possible that the other<br>
library's API is what's causing the problem?<br>
<span><font color="#888888"><br>
~Aaron<br>
</font></span><span><br>
><br>
> --<br>
> Regards,<br>
> Dhriti Khanna<br>
> PhD Scholar<br>
> IIIT Delhi<br>
><br>
</span><div><div>> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">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/<wbr>mailman/listinfo/cfe-dev</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font color="#f1c232">Regards,</font><div><font color="#f1c232">Dhriti Khanna</font></div><div><font color="#f1c232">PhD Scholar</font></div><div><font color="#f1c232">IIIT Delhi</font></div></div></div></div></div>
</div></div>