Skip to content

Commit

Permalink
Implemented Template Type Parameter import
Browse files Browse the repository at this point in the history
  • Loading branch information
esakellari committed Jan 26, 2016
1 parent d570c47 commit 2cfbaef
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace clang {
// FIXME: DependentDecltypeType
QualType VisitRecordType(const RecordType *T);
QualType VisitEnumType(const EnumType *T);
// FIXME: TemplateTypeParmType
QualType VisitTemplateTypeParmType(const TemplateTypeParmType *T);
// FIXME: SubstTemplateTypeParmType
QualType VisitTemplateSpecializationType(const TemplateSpecializationType *T);
QualType VisitElaboratedType(const ElaboratedType *T);
Expand Down Expand Up @@ -1725,6 +1725,18 @@ QualType ASTNodeImporter::VisitEnumType(const EnumType *T) {
return Importer.getToContext().getTagDeclType(ToDecl);
}

QualType ASTNodeImporter::VisitTemplateTypeParmType(const TemplateTypeParmType *T) {
TemplateTypeParmDecl *ToDecl
= dyn_cast_or_null<TemplateTypeParmDecl>(Importer.Import(T->getDecl()));
if (!ToDecl)
return QualType();

return Importer.getToContext().getTemplateTypeParmType(T->getDepth(),
T->getIndex(),
T->isParameterPack(),
ToDecl);
}

QualType ASTNodeImporter::VisitTemplateSpecializationType(
const TemplateSpecializationType *T) {
TemplateName ToTemplate = Importer.Import(T->getTemplateName());
Expand Down Expand Up @@ -4099,7 +4111,7 @@ Decl *ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) {

if (DTemplated->isCompleteDefinition() &&
!D2Templated->isCompleteDefinition()) {
// FIXME: Import definition!
ImportDefinition(DTemplated, D2Templated);
}

return D2;
Expand Down

0 comments on commit 2cfbaef

Please sign in to comment.