Andreas Georgiou via llvm-dev
2016-Jun-25 16:44 UTC
[llvm-dev] Get variable declaration type as String sometimes gives me wrong types.
Hello again, I have implmented an AST Visitor using clang. In my visitor exists the following function. virtual bool VisitVarDecl(VarDecl *var) { numVariables++; string varName = var->getQualifiedNameAsString(); string varType = var->getType().getAsString(); cout << "VisitVarDecl: " << varName << " of type " << varType << "\n"; APIs << varType << ", "; return true; } Now the problem is that whenever a variable declaration exists in my code the visitor detects it but sometimes returns me the wrong type.for Example if the type is size_t it will return int. if the size is char32_t it will again return int. I just want it to return whatever the type is even if is imaginary for exampleasdasd x; Thank you, Andreas Georgiou -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160625/607378bd/attachment.html>