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
15namespace P4 {
16
29class InstantiateDirectCalls : public Transform, public ResolutionContext {
30 MinimalNameGenerator nameGen; // used to generate new names
31
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_ */
Definition indexed_vector.h:31
Definition node.h:53
Definition referenceMap.h:36
Definition visitor.h:442
Definition visitor.h:78
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13