mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[silgen] Fix up EnumElementPatternInitialization::emitEnumMatch to use ownership.
This commit does a few things: 1. It uses SwitchEnumBuilder so we are not re-inventing any wheels. 2. Instead of hacking around not putting in a destroy for .None on the fail pass, just *do the right thing* and recognize that we have a binary case enum and in such a case, just emit code for the other case rather than use a default case (meaning no cleanup on .none). rdar://31145255
This commit is contained in:
@@ -346,3 +346,10 @@ bool SILBasicBlock::isNoReturn() const {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SILBasicBlock::isTrampoline() const {
|
||||
auto *Branch = dyn_cast<BranchInst>(getTerminator());
|
||||
if (!Branch)
|
||||
return false;
|
||||
return begin() == Branch->getIterator();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user