P4C
The P4 Compiler
Loading...
Searching...
No Matches
directCalls.h
1
/*
2
* Copyright 2017 VMware, Inc.
3
* SPDX-FileCopyrightText: 2017 VMware, Inc.
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
8
#ifndef FRONTENDS_P4_DIRECTCALLS_H_
9
#define FRONTENDS_P4_DIRECTCALLS_H_
10
11
#include "frontends/common/resolveReferences/resolveReferences.h"
12
#include "ir/ir.h"
13
#include "ir/pass_manager.h"
14
15
namespace
P4
{
16
29
class
InstantiateDirectCalls :
public
Transform
,
public
ResolutionContext {
30
MinimalNameGenerator
nameGen;
// used to generate new names
31
32
IR::IndexedVector<IR::Declaration>
insert;
33
34
public
:
35
InstantiateDirectCalls() { setName(
"InstantiateDirectCalls"
); }
36
const
IR::Node
*postorder(IR::P4Parser *parser)
override
;
37
const
IR::Node
*postorder(IR::P4Control *control)
override
;
38
const
IR::Node
*postorder(IR::MethodCallExpression *expression)
override
;
39
40
profile_t
init_apply(
const
IR::Node
*node)
override
{
41
auto
rv = Transform::init_apply(node);
42
node->apply(nameGen);
43
return
rv;
44
}
45
};
46
47
}
// namespace P4
48
49
#endif
/* FRONTENDS_P4_DIRECTCALLS_H_ */
P4::IR::IndexedVector
Definition
indexed_vector.h:31
P4::IR::Node
Definition
node.h:53
P4::MinimalNameGenerator
Definition
referenceMap.h:36
P4::Transform
Definition
visitor.h:442
P4::Visitor::profile_t
Definition
visitor.h:78
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:13
frontends
p4
directCalls.h
Generated by
1.13.2