TypeLoc-related cleanup: add FIXMEs to the places in validateType that need to

compute sub-TypeLocs, and fix the places that don't need them not to reuse the
parent TypeLoc.



Swift SVN r2374
This commit is contained in:
Eli Friedman
2012-07-19 04:01:59 +00:00
parent 7330aca582
commit fca009f280
4 changed files with 23 additions and 13 deletions

View File

@@ -60,11 +60,15 @@ void BuiltinModuleCache::lookupValue(Identifier Name, NLKind LookupKind,
ValueDecl *&Entry = Cache[Name];
if (Entry == 0)
if (Type Ty = getBuiltinType(M.Ctx, Name.str()))
Entry = new (M.Ctx) TypeAliasDecl(SourceLoc(), Name, SourceLoc(),
if (Entry == 0) {
if (Type Ty = getBuiltinType(M.Ctx, Name.str())) {
auto TAD = new (M.Ctx) TypeAliasDecl(SourceLoc(), Name, SourceLoc(),
Ty, nullptr, M.Ctx.TheBuiltinModule,
MutableArrayRef<Type>());
TAD->setType(MetaTypeType::get(TAD->getAliasType(), M.Ctx));
Entry = TAD;
}
}
if (Entry == 0)
Entry = getBuiltinValue(M.Ctx, Name);