Skip to content

Commit b6143c6

Browse files
committed
[NFC] Remove TypeChecker::getIntType
Inline it into its only caller
1 parent 69dc77f commit b6143c6

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ namespace {
24882488
// Make the integer literals for the parameters.
24892489
auto buildExprFromUnsigned = [&](unsigned value) {
24902490
LiteralExpr *expr = IntegerLiteralExpr::createFromUnsigned(ctx, value);
2491-
cs.setType(expr, TypeChecker::getIntType(ctx));
2491+
cs.setType(expr, ctx.getIntDecl()->getDeclaredInterfaceType());
24922492
return handleIntegerLiteralExpr(expr);
24932493
};
24942494

lib/Sema/TypeCheckType.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,6 @@ Type TypeChecker::getSubstringType(ASTContext &Context) {
394394
return Type();
395395
}
396396

397-
Type TypeChecker::getIntType(ASTContext &Context) {
398-
if (auto typeDecl = Context.getIntDecl())
399-
return typeDecl->getDeclaredInterfaceType();
400-
401-
return Type();
402-
}
403-
404397
Type TypeChecker::getInt8Type(ASTContext &Context) {
405398
if (auto typeDecl = Context.getInt8Decl())
406399
return typeDecl->getDeclaredInterfaceType();

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ Type getArraySliceType(SourceLoc loc, Type elementType);
348348
Type getOptionalType(SourceLoc loc, Type elementType);
349349
Type getStringType(ASTContext &ctx);
350350
Type getSubstringType(ASTContext &ctx);
351-
Type getIntType(ASTContext &ctx);
352351
Type getInt8Type(ASTContext &ctx);
353352
Type getUInt8Type(ASTContext &ctx);
354353

0 commit comments

Comments
 (0)