Prefer using known-identifiers to using getIdentifier.

I didn't add anything to the table, just made use of what was already there.
We have plenty of additional calls to getIdentifier that could probably benefit
from this kind of easy access as well.

This commit also removes FOUNDATION_MODULE_NAME and OBJC_MODULE_NAME from
Strings.h. Neither of these is likely to change in the future, and both
already have KnownIdentifiers equivalents in use.

No intended functionality change.

Swift SVN r29292
This commit is contained in:
Jordan Rose
2015-06-04 04:01:08 +00:00
parent 2d66428272
commit de81a3e15f
14 changed files with 36 additions and 49 deletions

View File

@@ -615,7 +615,7 @@ static Expr *createPropertyLoadOrCallSuperclassGetter(FuncDecl *accessor,
static ProtocolDecl *getNSCopyingProtocol(TypeChecker &TC,
DeclContext *DC) {
ASTContext &ctx = TC.Context;
auto foundation = ctx.getLoadedModule(ctx.getIdentifier("Foundation"));
auto foundation = ctx.getLoadedModule(ctx.Id_Foundation);
if (!foundation)
return nullptr;