Skip to content

Commit 0ec1cd7

Browse files
authored
Merge pull request #14684 from davezarzycki/nfc_workaround_clang_perf
2 parents 0ef3492 + a0e5e41 commit 0ec1cd7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/AST/Builtins.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,11 +1604,11 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
16041604
return getAllocWithTailElemsOperation(Context, Id, NumTailTypes);
16051605
}
16061606

1607-
BuiltinValueKind BV = llvm::StringSwitch<BuiltinValueKind>(OperationName)
1607+
auto BV = BuiltinValueKind::None;
16081608
#define BUILTIN(id, name, Attrs) \
1609-
.Case(name, BuiltinValueKind::id)
1609+
if (name == OperationName) { BV = BuiltinValueKind::id; } else
16101610
#include "swift/AST/Builtins.def"
1611-
.Default(BuiltinValueKind::None);
1611+
/* final "else" */ {}
16121612

16131613
// Filter out inappropriate overloads.
16141614
OverloadedBuiltinKind OBK = OverloadedBuiltinKinds[unsigned(BV)];

lib/SIL/SILModule.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,10 @@ const BuiltinInfo &SILModule::getBuiltinInfo(Identifier ID) {
455455
Info.ID = BuiltinValueKind::AllocWithTailElems;
456456
else {
457457
// Switch through the rest of builtins.
458-
Info.ID = llvm::StringSwitch<BuiltinValueKind>(OperationName)
459-
#define BUILTIN(ID, Name, Attrs) \
460-
.Case(Name, BuiltinValueKind::ID)
458+
#define BUILTIN(Id, Name, Attrs) \
459+
if (OperationName == Name) { Info.ID = BuiltinValueKind::Id; } else
461460
#include "swift/AST/Builtins.def"
462-
.Default(BuiltinValueKind::None);
461+
/* final "else" */ { Info.ID = BuiltinValueKind::None; }
463462
}
464463

465464
return Info;

0 commit comments

Comments
 (0)