[AST] Break down IdentTypeRepr to different subtypes.

This makes memory allocation for it more efficient and it's more convenient to handle.

Swift SVN r12541
This commit is contained in:
Argyrios Kyrtzidis
2014-01-18 20:19:09 +00:00
parent 20af73f973
commit 84e20a0620
16 changed files with 413 additions and 261 deletions

View File

@@ -294,14 +294,12 @@ bool ModelASTWalker::walkToTypeReprPre(TypeRepr *T) {
if (!handleAttrs(AttrT->getAttrs()))
return false;
} else if (auto IdT = dyn_cast<IdentTypeRepr>(T)) {
for (auto &comp : IdT->Components) {
if (!passNonTokenNode({ SyntaxNodeKind::TypeId,
CharSourceRange(comp.getIdLoc(),
comp.getIdentifier().getLength())
}))
return false;
}
} else if (auto IdT = dyn_cast<ComponentIdentTypeRepr>(T)) {
if (!passNonTokenNode({ SyntaxNodeKind::TypeId,
CharSourceRange(IdT->getIdLoc(),
IdT->getIdentifier().getLength())
}))
return false;
}
return true;
}