<div dir="ltr">I'm using libClang to parse the AST for Objective-C/C++ code, and have run into an issue with macro-like functions. Given something like this:<div><br></div><div>#define FOO(a, b) a + b</div><div><br></div><div>int main() {</div><div>  int a = 0;</div><div>  int b = 1;</div><div>  int c = FOO(a, b);</div><div>  return c;</div><div>}</div><div><br></div><div>I would like to be able to see references to a and b in the AST when I parse the "<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">int c = FOO(a, b);" line</span>. However, all I see in the AST is the "int c = " part (a Decl and a VarDecl).</div><div><br></div><div>I've done a bunch of searching, and people mention using CXTranslationUnit_DetailedPreprocessingRecord, which doesn't work for me. This adds children to the translation unit that reference the macro itself, but it doesn't give me access to the arguments passed into the function-like macro.</div><div><br></div><div>Short of using the C++ API, is there any way to get this information from libClang?</div><div><br></div><div>Thanks!</div><div>Joe</div></div>