mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user