[cfe-dev] Running clang programmatically
dgregor at apple.com
Thu Mar 18 09:24:35 CDT 2010
On Mar 18, 2010, at 7:00 AM, Stefan Seefeld wrote:
> I still have trouble running clang programmatically, and I'm not quite sure what goes wrong. I have attached a minimal test case demonstrating the problem:
> I compiled it as "g++ -o clang clang.cc -lCIndex", then invoke that on a little test C++ input, via "./clang test.cc".
> I then attempt to print the location of the first traversed cursor, but get nonsense. (The reported cursor type also seems incorrect, as I get a CXCursor_StructDecl, with an input file not containing any struct.)
That's probably __va_list_tag, which is defined in the predefines buffer for every source file (hence, a location that looks invalid). Get the cursor's spelling to see the name.
> Can anybody please help me figure out what I'm doing wrong ?
Looks like to me.
More information about the cfe-dev