P4C
The P4 Compiler
Loading...
Searching...
No Matches
inlinedActionsMetric.h
1/*
2Counts the number of actions inlined during the frontend stage by
3counting 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
13namespace P4 {
14
15class 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_ */
Definition visitor.h:413
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition metricsStructure.h:119