[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    [cfe-dev] Recovering pointer vs. reference typedefs from the AST
From:       Kenneth Hill <ken.j.hill () gmail ! com>
Date:       2012-05-29 20:14:29
Message-ID: CAKnoS5YGV_qbhXhDLKRKMWhR529CKH98V8h6rAgcQXQn9xWTJA () mail ! gmail ! com
[Download RAW message or body]

Consider the following simple header file processed with clang 3.0
with the "c++" option:

    struct Location
    {
    	double x, y;
    };

    typedef Location Loc;
    typedef Location *LocPtr;
    typedef Location &LocRef;

I can find nothing in the Python interface that differentiates the
cursor for Loc from LocPtr or LocRef (other than the location info).
In all three cases the cursor is of kind CursorKind.TYPEDEF_DECL, and
it's one child is of type CursorKind.TYPE_REF, from which I can use
get_definition() to find the cursor for struct Location.  But I can't
find a way to decide that Loc is a structure, LocPtr is a POINTER to a
structure, and LocRef is a REFERENCE to a structure.  The AST seems to
imply they are all identical typedefs.  Am I missing something?
_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic