Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Template Type Parameter import in ASTImporter class. #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion 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 @@ -1724,6 +1724,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