P4C
The P4 Compiler
Loading...
Searching...
No Matches
statements.h
1#ifndef BACKENDS_P4TOOLS_MODULES_SMITH_COMMON_STATEMENTS_H_
2#define BACKENDS_P4TOOLS_MODULES_SMITH_COMMON_STATEMENTS_H_
3
4#include "backends/p4tools/modules/smith/common/generator.h"
5#include "ir/indexed_vector.h"
6#include "ir/ir.h"
7
8namespace P4::P4Tools::P4Smith {
9
11 public:
12 explicit StatementGenerator(const SmithTarget &target) : Generator(target) {}
13
14 virtual ~StatementGenerator() = default;
15
16 virtual IR::Statement *genStatement(bool is_in_func);
17
18 IR::IndexedVector<IR::StatOrDecl> genBlockStatementHelper(bool is_in_func);
19
20 virtual IR::BlockStatement *genBlockStatement(bool is_in_func);
21
22 virtual IR::IfStatement *genConditionalStatement(bool is_in_func);
23
24 static void removeLval(const IR::Expression *left, const IR::Type *type);
25
26 virtual IR::Statement *genAssignmentStatement();
27
28 virtual IR::Statement *genMethodCallExpression(const IR::PathExpression *methodName,
29 const IR::ParameterList &params);
30
31 virtual IR::Statement *genMethodCallStatement(bool is_in_func);
32
33 virtual IR::Statement *genAssignmentOrMethodCallStatement(bool is_in_func);
34
35 virtual IR::ExitStatement *genExitStatement();
36
37 virtual IR::SwitchStatement *genSwitchStatement();
38
39 IR::ReturnStatement *genReturnStatement(const IR::Type *tp = nullptr);
40
41 virtual IR::ForStatement *genForLoopStatement(bool is_in_func);
42
43 virtual IR::ForInStatement *genForInLoopStatement(bool is_in_func);
44};
45
46} // namespace P4::P4Tools::P4Smith
47
48#endif /* BACKENDS_P4TOOLS_MODULES_SMITH_COMMON_STATEMENTS_H_ */
Definition node.h:52
Definition generator.h:10
Definition p4tools/modules/smith/core/target.h:17
virtual IR::ForInStatement * genForInLoopStatement(bool is_in_func)
Generate a for-in-loop statement.
Definition statements.cpp:443
virtual IR::ForStatement * genForLoopStatement(bool is_in_func)
Generate a for-loop statement.
Definition statements.cpp:417