[cfe-dev] Appropriate way of returning storage class in libclang

Guilherme guibufolo at gmail.com
Wed Sep 24 01:58:49 PDT 2014


Hello,

In libclang whenever asking for some property of an element a CXCursor
is passed. The cursor can point to any object type within an AST.

The problem is that only FunctionDecl and VarDecl as far as i know
have a storage class. If i oversaw anything please correct me.

The problem that i have is deciding what is a more appropriate way of
dealing with non FunctionDecl and VarDecl CXCursor.

There are two options:
1. Return SC_None if not FunctionDecl and not VarDecl aswell for the
proper cases
2. Add a custon SC_Not_Applcable to the libclang enum.

What do you guys think is the better solution in this case?

Thank you,
Red



More information about the cfe-dev mailing list