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