P4C
The P4 Compiler
Loading...
Searching...
No Matches
inlinedActionsMetric.h
1
/*
2
Counts the number of actions inlined during the frontend stage by
3
counting unique action names inside of blocks with annotantions of type
4
"Annotation::inlinedFromAnnotation".
5
*/
6
7
#ifndef FRONTENDS_P4_METRICS_INLINEDACTIONSMETRIC_H_
8
#define FRONTENDS_P4_METRICS_INLINEDACTIONSMETRIC_H_
9
10
#include "frontends/p4/metrics/metricsStructure.h"
11
#include "ir/ir.h"
12
13
namespace
P4
{
14
15
class
InlinedActionsMetricPass :
public
Inspector
{
16
private
:
17
Metrics
&metrics;
18
std::unordered_set<cstring> actions;
19
20
public
:
21
explicit
InlinedActionsMetricPass(
Metrics
&metricsRef) : metrics(metricsRef) {
22
setName(
"InlinedActionsMetricPass"
);
23
}
24
25
void
postorder(
const
IR::BlockStatement *block)
override
;
26
};
27
28
}
// namespace P4
29
30
#endif
/* FRONTENDS_P4_METRICS_INLINEDACTIONSMETRIC_H_ */
P4::Inspector
Definition
visitor.h:413
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:24
P4::Metrics
Definition
metricsStructure.h:119
frontends
p4
metrics
inlinedActionsMetric.h
Generated by
1.13.2