P4C
The P4 Compiler
Loading...
Searching...
No Matches
switchAddDefault.h
1/*
2 * Copyright 2020 Barefoot Networks, Inc.
3 * SPDX-FileCopyrightText: 2020 Barefoot Networks, Inc.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef FRONTENDS_P4_SWITCHADDDEFAULT_H_
9#define FRONTENDS_P4_SWITCHADDDEFAULT_H_
10
11#include "ir/ir.h"
12#include "ir/visitor.h"
13
14namespace P4 {
15
16/*
17 * find switch statements that do not cover all possible cases in their case list (no
18 * default: case and at least one action tag with no case) and add a default: {}
19 * case that does nothing.
20 */
21class SwitchAddDefault : public Modifier {
22 public:
23 void postorder(IR::SwitchStatement *) override;
24};
25
26} // namespace P4
27
28#endif /* FRONTENDS_P4_SWITCHADDDEFAULT_H_ */
Definition visitor.h:385
Definition switchAddDefault.h:21
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13