mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
a6e96dcb93
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.
32 lines
712 B
C++
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);
|