From 51a176173b46942e53834a674afaf50dd7bca841 Mon Sep 17 00:00:00 2001 From: Philippe Canal Date: Fri, 19 Oct 2012 13:24:46 +0000 Subject: [PATCH] Use llvm::isa rathen that QualType::isXYZ as the later reports about the canonical type while we are interested in the direct type. Make sure to recurse if needed after removing the typedefs git-svn-id: http://root.cern.ch/svn/root/trunk@46675 27541ba8-7e3a-0410-8455-c3a389f83636 --- lib/Utils/AST.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Utils/AST.cpp b/lib/Utils/AST.cpp index 54b751e2..ed7f876f 100644 --- a/lib/Utils/AST.cpp +++ b/lib/Utils/AST.cpp @@ -210,7 +210,7 @@ namespace utils { // In case of Int_t* we need to strip the pointer first, desugar and attach // the pointer once again. - if (QT->isPointerType()) { + if (isa(QT.getTypePtr())) { // Get the qualifiers. Qualifiers quals = QT.getQualifiers(); QT = GetPartiallyDesugaredType(Ctx, QT->getPointeeType(), TypesToSkip, @@ -223,7 +223,7 @@ namespace utils { // In case of Int_t& we need to strip the pointer first, desugar and attach // the pointer once again. - if (QT->isReferenceType()) { + if (isa(QT.getTypePtr())) { // Get the qualifiers. bool isLValueRefTy = isa(QT.getTypePtr()); Qualifiers quals = QT.getQualifiers(); @@ -273,6 +273,14 @@ namespace utils { return QT; } + // If we have a reference or pointer we still need to + // desugar what they point to. + if (isa(QT.getTypePtr()) || + isa(QT.getTypePtr()) ) { + return GetPartiallyDesugaredType(Ctx, QT, TypesToSkip, + fullyQualify); + } + NestedNameSpecifier* prefix = 0; const ElaboratedType* etype = llvm::dyn_cast(QT.getTypePtr());