Skip to content

Commit dfe82be

Browse files
authored
Merge pull request #32263 from davezarzycki/stop-being-a-sop
[SIL] NFC: "Stop being a sop"
2 parents c1a1cc6 + 6c46118 commit dfe82be

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/SIL/IR/SILGlobalVariable.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ SILGlobalVariable *SILGlobalVariable::create(SILModule &M, SILLinkage linkage,
2424
SILType loweredType,
2525
Optional<SILLocation> loc,
2626
VarDecl *Decl) {
27-
// Get a StringMapEntry for the variable. As a sop to error cases,
28-
// allow the name to have an empty string.
27+
// Get a StringMapEntry for the variable.
2928
llvm::StringMapEntry<SILGlobalVariable*> *entry = nullptr;
30-
if (!name.empty()) {
31-
entry = &*M.GlobalVariableMap.insert(std::make_pair(name, nullptr)).first;
32-
assert(!entry->getValue() && "global variable already exists");
33-
name = entry->getKey();
34-
}
29+
assert(!name.empty() && "Name required");
30+
31+
entry = &*M.GlobalVariableMap.insert(std::make_pair(name, nullptr)).first;
32+
assert(!entry->getValue() && "global variable already exists");
33+
name = entry->getKey();
3534

3635
auto var = new (M) SILGlobalVariable(M, linkage, isSerialized, name,
3736
loweredType, loc, Decl);

0 commit comments

Comments
 (0)