mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
FallThroughScope: remove SwitchBreak type
A `SwitchBreak` node should not have a specific associated `FallThroughScopeType`, since its semantics represent the fact of a `case` of the `switch` with no associated statements, and thus can be represented with the `FallThrough` behavior.
This commit is contained in:
@@ -227,7 +227,10 @@ fallThroughScopeImpl(const model::Binary &Model,
|
||||
rc_return FallThroughScopeType::FallThrough;
|
||||
} break;
|
||||
case ASTNode::NK_SwitchBreak: {
|
||||
rc_return FallThroughScopeType::SwitchBreak;
|
||||
|
||||
// `The `SwitchBreak` represents the fact that we fallthrough from the
|
||||
// switch out
|
||||
rc_return FallThroughScopeType::FallThrough;
|
||||
} break;
|
||||
case ASTNode::NK_Continue: {
|
||||
rc_return FallThroughScopeType::Continue;
|
||||
|
||||
@@ -21,7 +21,6 @@ enum class FallThroughScopeType {
|
||||
Return,
|
||||
Continue,
|
||||
LoopBreak,
|
||||
SwitchBreak,
|
||||
};
|
||||
|
||||
using FallThroughScopeTypeMap = std::map<const ASTNode *, FallThroughScopeType>;
|
||||
|
||||
@@ -30,8 +30,7 @@ static bool isPreferredAsFallThrough(FallThroughScopeType Element) {
|
||||
switch (Element) {
|
||||
case FallThroughScopeType::Return:
|
||||
case FallThroughScopeType::Continue:
|
||||
case FallThroughScopeType::LoopBreak:
|
||||
case FallThroughScopeType::SwitchBreak: {
|
||||
case FallThroughScopeType::LoopBreak: {
|
||||
return true;
|
||||
} break;
|
||||
case FallThroughScopeType::FallThrough:
|
||||
|
||||
Reference in New Issue
Block a user