[cfe-dev] libclang , clang_Cursor_isAnonymous what is an anonymous declaration
Nikola Smiljanic via cfe-dev
cfe-dev at lists.llvm.org
Mon Nov 16 12:02:42 PST 2015
Good to hear! Please don't reply directly in the future, reply to the
mailing list so everyone can see the discussion.
On Tue, Nov 17, 2015 at 4:16 AM, cedlemo <cedlemo at gmx.com> wrote:
> Thanks a lot Nikola,
>
> You were right, for the code with libclang, I am able to find the anonymous
> structures or unions if I create my translation unit
> like this:
>
> int main(int argc, char *argv[])
> {
> CXIndex Index = clang_createIndex(0, 1);
> const char *args[] = { "-x", "c++" };
> CXTranslationUnit TU = clang_createTranslationUnitFromSourceFile(Index,
> "record_decls.c", 2, args, 0, 0);
> clang_visitChildren(clang_getTranslationUnitCursor(TU), visitor, 0);
> clang_disposeTranslationUnit(TU);
> clang_disposeIndex(Index);
> return 0;
> }
>
> Regards.
>
> cedlemo
More information about the cfe-dev
mailing list