<div dir="ltr">Hi Alex,<br>I don't have this issue with namespace on my side, and I'm using the clang lib in C++ (clang::ParseAST function), not the cursor based. <br>Thus, I don't really know if your solution applies to mine.. but thanks, I will dig this as a start !<br>Vivien</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 12 juil. 2019 à 15:05, Alex Brachet-Mialot <<a href="mailto:alexbrachetmialot@gmail.com">alexbrachetmialot@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">I don’t work on clang but I have used the AST in a project of mine before so please take this with a grain of salt. I believe that an extern “C” block will require you to recurse down it to see the declarations within that block. At least this is what was true of namespaces. In that code (C not C++) my visitor function returned CXChildVisit_Recurse for namespaces. A quick look at the docs would suggest that the cursor kind for extern “C” is CXCursor_LinkageSpec. </div></div><div dir="auto"><br></div><div dir="auto">Hope that helps!</div><div dir="auto"><br></div><div dir="auto">-Alex</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 12, 2019 at 2:48 PM Vivien Millet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><div><br></div><div>I'm using clang ast for a while now to do meta compilation, and I just fell into a problem</div><div>when trying to parse vulkan library which has extern "C" in it. <br>Every symbol inside extern "C" seem to be striped from the TU and ast. <br>I tried to #undef __cplusplus and this time I got the symbols into the AST. <br>I first supposed it was a problem with missing includes or else, but clang ouput no errors, and more, now when tracing the files of every symbol in the AST i fall onto some windows headers I never had before #undef of __cplusplus.<br><br></div><div>Does someone know what goes wrong?</div><div><br></div><div>Thanks for your help !</div><div><br></div><div>Vivien</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</blockquote></div>