@@ -18,6 +18,7 @@ limitations under the License.
18
18
19
19
#include < map>
20
20
21
+ #include " error_reporter.h"
21
22
#include " lib/cstring.h"
22
23
23
24
namespace P4 {
@@ -71,6 +72,7 @@ const int ErrorType::WARN_ENTRIES_OUT_OF_ORDER = 1022;
71
72
const int ErrorType::WARN_MULTI_HDR_EXTRACT = 1023 ;
72
73
const int ErrorType::WARN_EXPRESSION = 1024 ;
73
74
const int ErrorType::WARN_DUPLICATE = 1025 ;
75
+ const int ErrorType::WARN_BRANCH_HINT = 1026 ;
74
76
75
77
// ------ Info messages -----------
76
78
const int ErrorType::INFO_INFERRED = WARN_MAX + 1 ;
@@ -124,9 +126,16 @@ std::map<int, cstring> ErrorCatalog::errorCatalog = {
124
126
{ErrorType::WARN_MULTI_HDR_EXTRACT, " multi_header_extract" _cs},
125
127
{ErrorType::WARN_EXPRESSION, " expr" _cs},
126
128
{ErrorType::WARN_DUPLICATE, " duplicate" _cs},
129
+ {ErrorType::WARN_BRANCH_HINT, " branch" _cs},
127
130
128
131
// Info messages
129
132
{ErrorType::INFO_INFERRED, " inferred" _cs},
130
133
{ErrorType::INFO_PROGRESS, " progress" _cs}};
131
134
135
+ void ErrorCatalog::initReporter (ErrorReporter &reporter) {
136
+ // by default, ignore warnings about branch hints -- user can turn them
137
+ // on with --Wwarn=branch
138
+ reporter.setDiagnosticAction (" branch" _cs, DiagnosticAction::Ignore);
139
+ }
140
+
132
141
} // namespace P4
0 commit comments