[cfe-dev] Static Function return variable not parsed correctly.

gladtbx gao2 at illinois.edu
Mon Feb 4 14:40:35 PST 2013


Hello all.

When I am using clang to process a c file, the return type of a static
function cannot be recognized.
For example, I have a function:
static int32_t handle_memory_buttons (int32_t key, double* value)

I use 

type_ptr = ND->getResultType().getTypePtr()

to get the return value type info. 

type_ptr->isBuiltinType()

returns true. But

 llvm::dyn_cast<BuiltinType>(type_ptr)

returns null and 

llvm::cast<BuiltinType>(type_ptr)

give me error like:

current parser token 'static'

My other function:

static double execute_operator (int32_t key, double arg1, double arg2)

does not have this issue, I can get double with the dyn_cast.
I have tried to use 

type_ptr = ND->getResultType().getUnqualifiedType().getTypePtr()

but still not getting the right return type.

Can anyone help?



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Static-Function-return-variable-not-parsed-correctly-tp4030259.html
Sent from the Clang Developers mailing list archive at Nabble.com.




More information about the cfe-dev mailing list