I want to be able to get the original type from the complex typedef. I'm using clang version 7.1.0
Look at the code below
typedef unsigned int uint32;
typedef uint32 * p_uint32;
p_uint32 p_uint_var;
I can extract type of p_uint_var
using VisitVarDecl
like so
virtual bool VisitVarDecl(VarDecl *var)
{
if(var->hasGlobalStorage())
{
llvm::outs() << var->getType().getAsString() << " " << var->getName() << "\n";
}
return true;
}
the output i get is this
p_uint32 p_uint_var
what I would like to recieve is this
unsigned int * p_uint_var
How can I achieve this?