I got the python bindings to work,
However I want to get size, and offset information for various types.
This doesn’t seem to be exposed in the Index.h file
Would I just add new routines to that file?
Where are the index.h routines at?
Would I add a new routine
int getSizeOfCursor(Cursor)
Get the ASTContext from the cursor,
I got the python bindings to work,
However I want to get size, and offset information for various types.
This doesn't seem to be exposed in the Index.h file
Would I just add new routines to that file?
Where are the index.h routines at?
Would I add a new routine
int getSizeOfCursor(Cursor)
Get the ASTContext from the cursor,
and then do GetTypeInfo from the ASTContext?
and then expose it on the cindex.py routine?
Are you interested in something like:
"int clang_getSizeOfType(CXType T);"
?
Start by taking a look at how
"int clang_getNumArgTypes(CXType T);"
is implemented.
That looks correct as a first approximation. But:
* change the return type to long long;
* you also need to check for incomplete types and return an error;
* LLVM and Clang style is to put star next to the identifier: "ASTUnit *AU";
* style: no spaces in function calls: "GetQualType(CT);"
* you might want to make this function work like sizeof() *or*
document the differences (for example, if computing the size requires
template instantiation, we should do it; or sizeof a reference type
equals the size of the type; what about sizeof void, sizeof a function
type etc...);
* please add tests. You need to extend c-index-test for that.
How do I send these patches back your way when I'm done.
Just send a patch to cfe-commits list for review. Develop your patch
on the latest trunk.
I want to add member offset, and expose the comment extractor also.
There's a review thread about the former [1] (if I understood your
intent correctly). I don't know if Loïc wants to continue to work on
that patch, though.