From: Sean Callanan Date: Thu, 2 Apr 2015 23:50:08 +0000 (+0000) Subject: Added support for attributed types to the ASTImporter. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce7f106aac9f30e15f2265702af313a1ab8ab61a;p=clang Added support for attributed types to the ASTImporter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233985 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 2442e8ec25..eb9b00ad84 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -67,6 +67,7 @@ namespace clang { // FIXME: DependentDecltypeType QualType VisitRecordType(const RecordType *T); QualType VisitEnumType(const EnumType *T); + QualType VisitAttributedType(const AttributedType *T); // FIXME: TemplateTypeParmType // FIXME: SubstTemplateTypeParmType QualType VisitTemplateSpecializationType(const TemplateSpecializationType *T); @@ -1724,6 +1725,27 @@ QualType ASTNodeImporter::VisitEnumType(const EnumType *T) { return Importer.getToContext().getTagDeclType(ToDecl); } +QualType ASTNodeImporter::VisitAttributedType(const AttributedType *T) { + QualType FromModifiedType = T->getModifiedType(); + QualType FromEquivalentType = T->getEquivalentType(); + QualType ToModifiedType; + QualType ToEquivalentType; + + if (!FromModifiedType.isNull()) { + ToModifiedType = Importer.Import(FromModifiedType); + if (ToModifiedType.isNull()) + return QualType(); + } + if (!FromEquivalentType.isNull()) { + ToEquivalentType = Importer.Import(FromEquivalentType); + if (ToEquivalentType.isNull()) + return QualType(); + } + + return Importer.getToContext().getAttributedType(T->getAttrKind(), + ToModifiedType, ToEquivalentType); +} + QualType ASTNodeImporter::VisitTemplateSpecializationType( const TemplateSpecializationType *T) { TemplateName ToTemplate = Importer.Import(T->getTemplateName());