Hi,

Imagine the very basic code below, it has some missing elements, we dont
have the foo() function and MyClass class,

```test.cpp
int main(int argc, char *argv[])
{
    MyClass* mc = new MyClass();
    mc.get_count();
    foo(1, 2, 3);
    std::cout << "this is a test" << endl;
}
```

How can I get AST for that code?
I tried `clang -Xclang -ast-dump -fsyntax-only test.cpp`, I can get the AST
tree but without MyClass and foo() function, it doesn't even say foo is a
function with 3 integer parameters.

This can be problematic for different cases for example IDE's where you
dont have all the project dependencies but yet you need to know what are
the elements in your code.

Is that possible to do with libclang? Any other suggestions are welcome.

Thanks
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to