P4C
The P4 Compiler
Loading...
Searching...
No Matches
error_type.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_LIB_ERROR_TYPE_H_
20#define BACKENDS_TOFINO_BF_P4C_LIB_ERROR_TYPE_H_
21
22#include <lib/error_catalog.h>
23
24namespace BFN {
25
26using namespace P4;
27
29class ErrorType : public P4::ErrorType {
30 public:
31 static const int WARN_TABLE_PLACEMENT = 1501;
32 static const int WARN_PRAGMA_USE = 1502;
33 static const int WARN_SUBSTITUTION = 1503;
34 static const int WARN_PHV_ALLOCATION = 1504;
35 static const int WARN_UNINIT_OVERLAY = 1505;
36
37 static const int FIRST_BACKEND_WARNING = WARN_TABLE_PLACEMENT;
38
41 static ErrorType instance;
42 return instance;
43 }
44
45 void printWarningsHelp(std::ostream &out);
46
47 private:
50 ErrorType() {
52 .add<ErrorMessage::MessageType::Warning, WARN_TABLE_PLACEMENT>("table-placement");
53 P4::ErrorCatalog::getCatalog().add<ErrorMessage::MessageType::Warning, WARN_PRAGMA_USE>(
54 "pragma-use");
55 P4::ErrorCatalog::getCatalog().add<ErrorMessage::MessageType::Warning, WARN_SUBSTITUTION>(
56 "substitution");
57 P4::ErrorCatalog::getCatalog().add<ErrorMessage::MessageType::Warning, WARN_PHV_ALLOCATION>(
58 "phv-allocation");
59 P4::ErrorCatalog::getCatalog().add<ErrorMessage::MessageType::Warning, WARN_UNINIT_OVERLAY>(
60 "uninitialized-overlay");
61 }
62};
63
64} // end namespace BFN
65
66#endif /* BACKENDS_TOFINO_BF_P4C_LIB_ERROR_TYPE_H_ */
static ErrorType & getErrorTypes()
in case we need to
Definition error_type.h:40
static ErrorCatalog & getCatalog()
Return the singleton object.
Definition error_catalog.h:105
bool add(const char *name, bool forceReplace=false)
Definition error_catalog.h:117
Definition error_catalog.h:33
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24