Files
revng-revng/lib/RestructureCFG/SimplifyImplicitStatement.h
T
Andrea Gussoni 061bc52bc2 BeautifyGHAST: implicit statements simplification
Introduce implicit statements simplification phase, specifically:
- A implicit `return` simplification: `return` statements in `void`
  type functions, which are not followed by any other scope, can be
  omitted.
- A implicit `continue` simplification: `continue` statements whose
  fallthrough leads directly to the end of the cycle scope (i.e., to
  execute another iteration of the enclosing loop), can be omitted.

In order to avoid the printing of the implicit `return`, we need an
additional `emitReturn` parameter in the `emitBasicBlock` method of the
`CCodeGenerator` class.
2023-10-23 18:16:20 +02:00

14 lines
256 B
C++

#pragma once
//
// Copyright rev.ng Labs Srl. See LICENSE.md for details.
//
// Forward declarations
class ASTNode;
class ASTTree;
extern void simplifyImplicitReturn(ASTTree &AST, ASTNode *RootNode);
extern void simplifyImplicitContinue(ASTTree &AST);