r233985 - Added support for attributed types to the ASTImporter.

Aaron Ballman aaron at aaronballman.com
Thu Apr 2 17:47:16 PDT 2015


Test cases?

~Aaron

On Thu, Apr 2, 2015 at 7:50 PM, Sean Callanan <scallanan at apple.com> wrote:
> Author: spyffe
> Date: Thu Apr  2 18:50:08 2015
> New Revision: 233985
>
> URL: http://llvm.org/viewvc/llvm-project?rev=233985&view=rev
> Log:
> Added support for attributed types to the ASTImporter.
>
> <rdar://problem/20403544>
>
> Modified:
>     cfe/trunk/lib/AST/ASTImporter.cpp
>
> Modified: cfe/trunk/lib/AST/ASTImporter.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=233985&r1=233984&r2=233985&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/ASTImporter.cpp (original)
> +++ cfe/trunk/lib/AST/ASTImporter.cpp Thu Apr  2 18:50:08 2015
> @@ -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(
>    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());
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list