Files
revng-revng/lib/RestructureCFG/FallThroughScopeAnalysis.h
Andrea Gussoni a6e96dcb93 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.
2024-05-07 14:17:05 +02:00

32 lines
712 B
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "revng/Model/IRHelpers.h"
// Forward declarations
class ASTNode;
class ASTTree;
// This `enum class` is used to represent the fallthrough type
enum class FallThroughScopeType {
FallThrough,
// This is a placeholder state to represent the combination of two no
// fallthrough states
MixedNoFallThrough,
CallNoReturn,
Return,
Continue,
LoopBreak,
};
using FallThroughScopeTypeMap = std::map<const ASTNode *, FallThroughScopeType>;
bool fallsThrough(FallThroughScopeType Element);
extern FallThroughScopeTypeMap
computeFallThroughScope(const model::Binary &Model, ASTNode *RootNode);