|
|
void | add_comment (std::ostream &out, cstring str, std::string_view sep="") |
| |
|
void | add_space (std::ostream &out, int size) |
| |
|
const char * | addr2line (void *addr, const char *text) |
| |
|
void | backtrace_fill_stacktrace (std::string &msg, void *const *backtrace, int size) |
| |
|
template<class Iter> |
| Iter | begin (std::pair< Iter, Iter > pr) |
| |
|
template<class... Args> |
| std::string | bug_helper (boost::format &f, std::string_view position, std::string_view tail, Args &&...args) |
| |
|
cstring | cgMakeString (char c) |
| |
|
cstring | cgMakeString (const IR::INode *node) |
| |
|
cstring | cgMakeString (const IR::Node *node) |
| |
|
cstring | cgMakeString (cstring s) |
| |
|
void | checkParametersForMap (const IR::ParameterList *params, std::map< cstring, const IR::Expression * > *vars) |
| |
|
void | compareValuesInMaps (std::map< cstring, const IR::Expression * > *oldValues, std::map< cstring, const IR::Expression * > *newValues) |
| |
|
template<class C, class T> |
| bool | contains (C &c, const T &val) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | contains (const ordered_set< T, C1, A1 > &a, const U &b) -> decltype(b.begin(), true) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | contains (std::set< T, C1, A1 > &a, U &b) -> decltype(b.begin(), true) |
| |
|
template<class C, class Pred> |
| bool | contains_if (C &c, Pred pred) |
| |
| const IR::Expression * | convert (const IR::Expression *expression, const IR::Type *type) |
| |
|
void | dbprint (const IHasDbPrint *o) |
| |
|
void | dbprint (const IR::Node &n) |
| |
|
void | dbprint (const IR::Node *n) |
| |
|
void | dbprint (const std::set< const IR::Expression * > s) |
| |
| unsigned | diagnosticCount () |
| |
|
void | dump (const big_int &i) |
| |
|
void | dump (const big_int *i) |
| |
|
void | dump (const ControlFlowVisitor::flow_join_info_t &info) |
| |
|
void | dump (const ControlFlowVisitor::flow_join_info_t *info) |
| |
|
void | dump (const ControlFlowVisitor::flow_join_points_t &fjp) |
| |
|
void | dump (const ControlFlowVisitor::flow_join_points_t *fjp) |
| |
|
void | dump (const hvec_set< const P4::ComputeDefUse::loc_t * > &p) |
| |
|
void | dump (const IR::INode *n) |
| |
|
void | dump (const IR::INode *n, unsigned maxdepth) |
| |
|
void | dump (const IR::Node *n) |
| |
|
void | dump (const IR::Node *n, unsigned maxdepth) |
| |
|
void | dump (const JsonData *json) |
| |
|
void | dump (const match_t &m) |
| |
|
void | dump (const match_t *m) |
| |
|
void | dump (const P4::AllDefinitions *d) |
| |
|
void | dump (const P4::ComputeDefUse &du) |
| |
|
void | dump (const P4::ComputeDefUse *du) |
| |
|
void | dump (const P4::ComputeDefUse::loc_t &p) |
| |
|
void | dump (const P4::Definitions *d) |
| |
|
void | dump (const P4::LocationSet *s) |
| |
|
void | dump (const P4::ProgramPoint &p) |
| |
|
void | dump (const P4::ProgramPoint *p) |
| |
|
void | dump (const P4::ProgramPoints &p) |
| |
|
void | dump (const P4::ProgramPoints *p) |
| |
|
void | dump (const P4::StorageLocation *s) |
| |
|
void | dump (const P4::StorageMap *s) |
| |
|
void | dump (const SplitFlowVisit_base *split) |
| |
|
void | dump (const Visitor::Context *ctxt) |
| |
|
void | dump (P4::TypeVariableSubstitution &tvs) |
| |
|
void | dump (P4::TypeVariableSubstitution *tvs) |
| |
|
void | dump (std::ostream &out, const IR::Node *n) |
| |
|
void | dump (std::ostream &out, const IR::Node *n, unsigned maxdepth) |
| |
|
void | dump (std::ostream &out, const Visitor::Context *ctxt) |
| |
|
void | dump (uintptr_t p) |
| |
|
void | dump (uintptr_t p, unsigned maxdepth) |
| |
|
void | dump_notype (const IR::INode *n) |
| |
|
void | dump_notype (const IR::INode *n, unsigned maxdepth) |
| |
|
void | dump_notype (const IR::Node *n) |
| |
|
void | dump_notype (const IR::Node *n, unsigned maxdepth) |
| |
|
void | dump_notype (uintptr_t p) |
| |
|
void | dump_notype (uintptr_t p, unsigned maxdepth) |
| |
|
void | dump_src (const IR::INode *n) |
| |
|
void | dump_src (const IR::INode *n, unsigned maxdepth) |
| |
|
void | dump_src (const IR::Node *n) |
| |
|
void | dump_src (const IR::Node *n, unsigned maxdepth) |
| |
|
void | dumpP4 (const IR::INode *node) |
| |
|
std::string | dumpToString (const IR::Node *n) |
| |
|
template<class Iter> |
| Iter | end (std::pair< Iter, Iter > pr) |
| |
|
template<class C, class Pred> |
| void | erase_if (C &c, Pred pred) |
| |
|
template<typename... Args> |
| void | error (const char *format, Args &&...args) |
| | Report an error with the given message.
|
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> |
| void | error (const char *format, const T &node, Args &&...args) |
| | The const ref variant of the above.
|
| |
| template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> |
| void | error (const char *format, const T *node, Args &&...args) |
| |
| template<typename... Args> |
| void | error (const int kind, const char *format, Args &&...args) |
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> |
| void | error (const int kind, const char *format, const T &node, Args &&...args) |
| | The const ref variant of the above.
|
| |
| template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> |
| void | error (const int kind, const char *format, const T *node, Args &&...args) |
| |
|
template<class... Args> |
| ErrorMessage | error_helper (boost::format &f, Args &&...args) |
| |
|
template<class... Args> |
| ErrorMessage | error_helper (boost::format &f, const std::string &prefix, const Util::SourceInfo &info, const std::string &suffix, Args &&...args) |
| |
|
template<class... Args> |
| ErrorMessage | error_helper (boost::format &f, ErrorMessage msg, Args &&...args) |
| |
| unsigned | errorCount () |
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> |
| void | errorWithSuffix (const int kind, const char *format, const char *suffix, const T *node, Args &&...args) |
| | This is similar to the above method, but also has a suffix.
|
| |
| const char * | exename (const char *argv0) |
| |
|
template<class C, class T> |
| C::iterator | find (C &c, const T &val) |
| |
|
template<class Iter, class Fn> |
| Fn | for_each (std::pair< Iter, Iter > range, Fn fn) |
| |
| template<typename NodeType, typename Func> |
| void | forAllMatching (const IR::Node *root, Func &&function) |
| |
| template<class Cont> |
| std::ostream & | format_container (std::ostream &out, const Cont &container, char lbrace, char rbrace) |
| |
| P4RuntimeAPI | generateP4Runtime (const IR::P4Program *program, cstring arch) |
| |
|
template<class K, class T, class V, class Comp, class Alloc> |
| V | get (const hvec_map< K, V, Comp, Alloc > &m, T key, V def=V()) |
| |
|
template<class K, class T, class V, class Comp, class Alloc> |
| V | get (const hvec_map< K, V, Comp, Alloc > *m, T key, V def=V()) |
| |
| template<typename Map, typename Key> |
| Map::mapped_type | get (const Map &m, const Key &key) |
| |
|
template<class Map, typename Key, typename Value> |
| Map::mapped_type | get (const Map &m, const Key &key, Value &&def) |
| |
|
template<typename Map, typename Key> |
| Map::mapped_type | get (const Map *m, const Key &key) |
| |
|
template<class Map, typename Key, typename Value> |
| Map::mapped_type | get (const Map *m, const Key &key, Value &&def) |
| |
|
template<class Map, typename Key> |
| std::optional< typename Map::mapped_type > | get_optional (const Map &m, const Key &key) |
| |
|
const IR::Expression * | getConstant (const ScalarValue *constant) |
| |
| DebugHook | getDiagnosticCountInPassHook (BaseCompileContext &ctxt=BaseCompileContext::get()) |
| | This creates a debug hook that prints information about the number of diagnostics of different levels (error, warning, info) printed by each of the pass after it ended. This is intended to help in debuggig and testing.
|
| |
| std::filesystem::path | getExecutablePath () |
| |
| std::filesystem::path | getExecutablePath (const std::filesystem::path &suggestedPath) |
| |
|
std::string | getIndent (int l) |
| |
|
template<class K, class T, class V, class Comp, class Alloc> |
| const V * | getref (const hvec_map< K, V, Comp, Alloc > &m, T key) |
| |
|
template<class K, class T, class V, class Comp, class Alloc> |
| const V * | getref (const hvec_map< K, V, Comp, Alloc > *m, T key) |
| |
| template<typename Map, typename Key> |
| const Map::mapped_type * | getref (const Map &m, const Key &key) |
| |
|
template<typename Map, typename Key> |
| const Map::mapped_type * | getref (const Map *m, const Key &key) |
| |
|
template<class K, class T, class V, class Comp, class Alloc> |
| V * | getref (hvec_map< K, V, Comp, Alloc > &m, T key) |
| |
|
template<class K, class T, class V, class Comp, class Alloc> |
| V * | getref (hvec_map< K, V, Comp, Alloc > *m, T key) |
| |
|
template<typename Map, typename Key> |
| Map::mapped_type * | getref (Map &m, const Key &key) |
| |
|
template<typename Map, typename Key> |
| Map::mapped_type * | getref (Map *m, const Key &key) |
| |
|
bool | hasVarbitsOrUnions (const TypeMap *typeMap, const IR::Type *type) |
| | True if the type contains any varbit or header_union subtypes.
|
| |
| template<typename... Args> |
| void | info (const int kind, const char *format, Args &&...args) |
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> |
| void | info (const int kind, const char *format, const T &node, Args &&...args) |
| | The const ref variant of the above.
|
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> |
| void | info (const int kind, const char *format, const T *node, Args &&...args) |
| | Report info messages of type kind. Requires that the node argument have source info.
|
| |
| unsigned | infoCount () |
| |
|
template<class T, class C1, class A1, class U> |
| auto | intersects (const ordered_set< T, C1, A1 > &a, const U &b) -> decltype(b.begin(), true) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | intersects (std::set< T, C1, A1 > &a, U &b) -> decltype(b.begin(), true) |
| |
|
bool | isAsync (const IR::Vector< IR::Method > methods, cstring callee, cstring caller) |
| |
|
bool | isReachable (cstring stateName, const IR::IndexedVector< IR::ParserState > &states) |
| |
|
bool | isSystemFile (cstring filename) |
| | Try to guess whether a file is a "system" file.
|
| |
| bool | isTerminalState (IR::ID id) |
| |
|
template<class Map> |
| IterKeys< typename Map::const_iterator > | Keys (const Map &m) |
| |
|
template<class Map> |
| IterKeys< typename Map::iterator > | Keys (Map &m) |
| |
|
template<class PairIter> |
| IterKeys< PairIter > | Keys (std::pair< PairIter, PairIter > range) |
| |
|
template<class C> |
| C::const_iterator | max_element (const C &c) |
| |
|
template<class C, class Compare> |
| C::const_iterator | max_element (const C &c, Compare comp) |
| |
|
template<class C> |
| C::const_iterator | min_element (const C &c) |
| |
|
template<class C, class Compare> |
| C::const_iterator | min_element (const C &c, Compare comp) |
| |
| template<typename NodeType, typename RootType, typename Func> |
| const RootType * | modifyAllMatching (const RootType *root, Func &&function) |
| |
|
bool | names_overlap (cstring name1, cstring name2) |
| | Test to see if names denote overlapping locations.
|
| |
|
std::ostream * | openFile (const std::filesystem::path &name, bool nullOnError) |
| |
|
bool | operator!= (const char *a, cstring b) |
| |
|
bool | operator!= (const std::string &a, cstring b) |
| |
|
Pattern | operator!= (int v, const Pattern &a) |
| |
|
template<class T> |
| auto | operator!= (T a, const StringRef &b) -> decltype(b.operator!=(a)) |
| |
|
Pattern | operator% (int v, const Pattern &a) |
| |
|
bitvec | operator& (bitvec &&a, const bitvec &b) |
| |
|
Pattern | operator& (int v, const Pattern &a) |
| |
|
Pattern | operator&& (int v, const Pattern &a) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | operator&= (ordered_set< T, C1, A1 > &a, const U &b) -> decltype(b.begin(), a) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | operator&= (std::set< T, C1, A1 > &a, U &b) -> decltype(b.begin(), a) |
| |
|
Pattern | operator* (int v, const Pattern &a) |
| |
|
std::string | operator+ (char a, cstring b) |
| |
|
std::string | operator+ (const char *a, cstring b) |
| |
|
std::string | operator+ (const char *s, const StringRef &a) |
| |
|
std::string | operator+ (const std::string &s, const StringRef &a) |
| |
|
std::string | operator+ (const StringRef &s, const char *a) |
| |
|
std::string | operator+ (const StringRef &s, const std::string &a) |
| |
|
std::string | operator+ (const StringRef &s, const StringRef &a) |
| |
|
std::string | operator+ (const StringRef &s, cstring a) |
| |
|
std::string | operator+ (cstring a, char b) |
| |
|
std::string | operator+ (cstring a, const char *b) |
| |
|
std::string | operator+ (cstring a, const std::string &b) |
| |
|
std::string | operator+ (cstring a, cstring b) |
| |
|
std::string | operator+ (cstring s, const StringRef &a) |
| |
|
Pattern | operator+ (int v, const Pattern &a) |
| |
|
std::string | operator+ (std::string a, cstring b) |
| |
|
std::string & | operator+= (std::string &a, cstring b) |
| |
|
std::string & | operator+= (std::string &s, const StringRef &a) |
| |
|
bitvec | operator- (bitvec &&a, const bitvec &b) |
| |
| template<RangeUnit Unit, Endian Order> |
| std::pair< HalfOpenRange< Unit, Order >, HalfOpenRange< Unit, Order > > | operator- (ClosedRange< Unit, Order > left, ClosedRange< Unit, Order > right) |
| |
| template<RangeUnit Unit, Endian Order> |
| std::pair< HalfOpenRange< Unit, Order >, HalfOpenRange< Unit, Order > > | operator- (HalfOpenRange< Unit, Order > left, HalfOpenRange< Unit, Order > right) |
| |
|
Pattern | operator- (int v, const Pattern &a) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | operator-= (ordered_set< T, C1, A1 > &a, const U &b) -> decltype(b.begin(), a) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | operator-= (std::set< T, C1, A1 > &a, U &b) -> decltype(b.begin(), a) |
| |
|
Pattern | operator/ (int v, const Pattern &a) |
| |
|
bool | operator< (const UnparsedConstant &a, const UnparsedConstant &b) |
| |
|
Pattern | operator< (int v, const Pattern &a) |
| |
|
template<class T> |
| auto | operator< (T a, const StringRef &b) -> decltype(b.operator>(a)) |
| |
|
Pattern | operator<< (int v, const Pattern &a) |
| |
|
std::ostream & | operator<< (std::ostream &os, const bitvec &bv) |
| |
|
std::ostream & | operator<< (std::ostream &os, const hex &h) |
| |
|
std::ostream & | operator<< (std::ostream &os, const hexvec &h) |
| |
|
std::ostream & | operator<< (std::ostream &os, const StringRef &a) |
| |
|
std::ostream & | operator<< (std::ostream &os, indent_t i) |
| |
|
std::ostream & | operator<< (std::ostream &os, n4 v) |
| |
|
std::ostream & | operator<< (std::ostream &out, const AllocTrace &at) |
| |
|
std::ostream & | operator<< (std::ostream &out, const Backtrack::trigger &trigger) |
| |
|
template<RangeUnit Unit, Endian Order> |
| std::ostream & | operator<< (std::ostream &out, const ClosedRange< Unit, Order > &range) |
| |
|
std::ostream & | operator<< (std::ostream &out, const ComputeDefUse::defuse_t &du) |
| |
|
std::ostream & | operator<< (std::ostream &out, const ComputeDefUse::loc_t &loc) |
| |
|
std::ostream & | operator<< (std::ostream &out, const ControlFlowVisitor::flow_join_info_t &info) |
| |
|
std::ostream & | operator<< (std::ostream &out, const ControlFlowVisitor::flow_join_points_t &fjp) |
| |
|
std::ostream & | operator<< (std::ostream &out, const Dump &d) |
| |
|
template<RangeUnit Unit, Endian Order> |
| std::ostream & | operator<< (std::ostream &out, const HalfOpenRange< Unit, Order > &range) |
| |
|
std::ostream & | operator<< (std::ostream &out, const hvec_set< const ComputeDefUse::loc_t * > &s) |
| |
|
std::ostream & | operator<< (std::ostream &out, const IHasDbPrint &obj) |
| |
|
std::ostream & | operator<< (std::ostream &out, const IHasDbPrint *obj) |
| |
|
std::ostream & | operator<< (std::ostream &out, const IR::Vector< IR::Annotation > &v) |
| |
|
std::ostream & | operator<< (std::ostream &out, const IR::Vector< IR::Expression > &v) |
| |
|
std::ostream & | operator<< (std::ostream &out, const IR::Vector< IR::Expression > *v) |
| |
|
std::ostream & | operator<< (std::ostream &out, const JsonData &json) |
| |
|
std::ostream & | operator<< (std::ostream &out, const JsonData *json) |
| |
|
std::ostream & | operator<< (std::ostream &out, const LTBitMatrix &bm) |
| |
|
std::ostream & | operator<< (std::ostream &out, const match_t &m) |
| |
|
std::ostream & | operator<< (std::ostream &out, const MatchRegister &c) |
| |
|
template<typename T> |
| std::ostream & | operator<< (std::ostream &out, const ordered_set< T > &set) |
| |
|
template<class T> |
| std::ostream & | operator<< (std::ostream &out, const RangeIter< T > &r) |
| |
|
std::ostream & | operator<< (std::ostream &out, const SplitFlowVisit_base &split) |
| |
|
std::ostream & | operator<< (std::ostream &out, const std::pair< const IR::Node *, const hvec_set< const ComputeDefUse::loc_t * > > &p) |
| |
|
std::ostream & | operator<< (std::ostream &out, const std::pair< const P4::IR::Expression *, cstring > &p) |
| |
|
template<class T> |
| std::ostream & | operator<< (std::ostream &out, const std::set< T > &set) |
| |
|
template<class T> |
| std::ostream & | operator<< (std::ostream &out, const std::vector< T > &vec) |
| |
|
std::ostream & | operator<< (std::ostream &out, const UniqueAttachedId &uai) |
| |
|
std::ostream & | operator<< (std::ostream &out, const UniqueAttachedId::type_t type) |
| |
|
std::ostream & | operator<< (std::ostream &out, const UniqueId &ui) |
| |
|
std::ostream & | operator<< (std::ostream &out, const UnparsedConstant &constant) |
| |
|
std::ostream & | operator<< (std::ostream &out, cstring s) |
| |
|
std::ostream & | operator<< (std::ostream &out, P4::StandardExceptions e) |
| |
|
std::ostream & | operator<< (std::ostream &s, const MarshaledFrom &m) |
| |
|
Pattern | operator<= (int v, const Pattern &a) |
| |
|
template<class T> |
| auto | operator<= (T a, const StringRef &b) -> decltype(b.operator>=(a)) |
| |
|
bool | operator== (const char *a, cstring b) |
| |
|
bool | operator== (const std::string &a, cstring b) |
| |
|
Pattern | operator== (int v, const Pattern &a) |
| |
|
template<class T> |
| auto | operator== (T a, const StringRef &b) -> decltype(b.operator==(a)) |
| |
|
Pattern | operator> (int v, const Pattern &a) |
| |
|
template<class T> |
| auto | operator> (T a, const StringRef &b) -> decltype(b.operator<(a)) |
| |
|
Pattern | operator>= (int v, const Pattern &a) |
| |
|
template<class T> |
| auto | operator>= (T a, const StringRef &b) -> decltype(b.operator<=(a)) |
| |
|
bool | operator>> (const char *p, LTBitMatrix &bm) |
| |
|
bool | operator>> (const char *p, match_t &m) |
| |
|
bool | operator>> (const char *s, bitvec &bv) |
| |
|
bool | operator>> (cstring s, UniqueAttachedId::type_t &type) |
| |
|
Pattern | operator>> (int v, const Pattern &a) |
| |
|
std::istream & | operator>> (std::istream &in, std::unique_ptr< JsonData > &json) |
| |
|
std::istream & | operator>> (std::istream &is, bitvec &bv) |
| |
|
bitvec | operator^ (bitvec &&a, const bitvec &b) |
| |
|
Pattern | operator^ (int v, const Pattern &a) |
| |
|
bitvec | operator| (bitvec &&a, const bitvec &b) |
| |
|
Pattern | operator| (int v, const Pattern &a) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | operator|= (ordered_set< T, C1, A1 > &a, const U &b) -> decltype(b.begin(), a) |
| |
|
template<class T, class C1, class A1, class U> |
| auto | operator|= (std::set< T, C1, A1 > &a, U &b) -> decltype(b.begin(), a) |
| |
|
Pattern | operator|| (int v, const Pattern &a) |
| |
| const IR::Expression * | optimizeExpression (const IR::Expression *node) |
| |
| IR::Constant * | parseConstant (const Util::SourceInfo &srcInfo, const UnparsedConstant &constant, long defaultValue) |
| |
| int | parseConstantChecked (const Util::SourceInfo &srcInfo, const UnparsedConstant &constant) |
| |
| template<typename C = P4V1::Converter> |
| const IR::P4Program * | parseP4File (const ParserOptions &options) |
| |
| const IR::P4Program * | parseP4String (const char *sourceFile, unsigned sourceLine, const std::string &input, CompilerOptions::FrontendVersion version) |
| |
|
const IR::P4Program * | parseP4String (const std::string &input, CompilerOptions::FrontendVersion version) |
| |
|
template<class C, class Pred> |
| void | remove_if (C &c, Pred pred) |
| |
|
void | removeVarsContaining (std::map< cstring, const IR::Expression * > *vars, cstring name) |
| |
| void | serializeP4RuntimeIfRequired (const IR::P4Program *program, const CompilerOptions &options) |
| |
|
void | setup_signals () |
| |
| SplitResult< IR::Statement > | splitStatementBefore (const IR::Statement *stat, std::function< bool(const IR::Statement *, const P4::Visitor_Context *)> predicate, P4::NameGenerator &nameGen, P4::TypeMap *typeMap=nullptr) |
| | Split stat so that on every control-flow path all the statements up to the first one matching predicate are in SplitResult::before, while the rest (starting from the matching statemet) is in SplitResult::after.
|
| |
|
template<typename K, typename V, typename C, typename Cont> |
| void | swap (flat_map< K, V, C, Cont > &lhs, flat_map< K, V, C, Cont > &rhs) |
| |
| template<RangeUnit Unit, Endian Order> |
| std::optional< ClosedRange< Unit, Order > > | toClosedRange (HalfOpenRange< Unit, Order > halfOpenRange) |
| |
| template<RangeUnit Unit, Endian Order> |
| HalfOpenRange< Unit, Order > | toHalfOpenRange (ClosedRange< Unit, Order > closedRange) |
| |
|
std::string | toP4 (const IR::INode *node) |
| |
|
std::ostream & | toStream (std::ostream &out, RangeUnit unit, Endian order, int lo, int hi, bool closed) |
| |
|
std::string | toString (const SpecSignature &sig) |
| |
|
cstring | toString (const TernaryBool &c) |
| |
| template<typename NodeType, typename Func> |
| const IR::Node * | transformAllMatching (const IR::Node *root, Func &&function) |
| |
|
template<typename... Args> |
| void | typeError (const char *format, Args &&...args) |
| |
|
UnparsedConstant | unparsedConstant (const IR::AnnotationToken *token) |
| |
|
template<class Map> |
| IterValues< typename Map::const_iterator > | Values (const Map &m) |
| |
|
template<class Map> |
| IterValues< typename Map::iterator > | Values (Map &m) |
| |
|
template<class PairIter> |
| IterValues< PairIter > | Values (std::pair< PairIter, PairIter > range) |
| |
|
template<class M> |
| MapForKey< M > | ValuesForKey (M &m, typename M::key_type k) |
| |
|
template<typename... Args> |
| void | warning (const char *format, Args &&...args) |
| | Report a warning with the given message.
|
| |
| template<typename... Args> |
| void | warning (const int kind, const char *format, Args &&...args) |
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T> && !std::is_pointer_v<T>>, class... Args> |
| void | warning (const int kind, const char *format, const T &node, Args &&...args) |
| | The const ref variant of the above.
|
| |
|
template<class T, typename = std::enable_if_t<Util::has_SourceInfo_v<T>>, class... Args> |
| void | warning (const int kind, const char *format, const T *node, Args &&...args) |
| | Report warnings of type kind. Requires that the node argument have source info.
|
| |
| unsigned | warningCount () |
| |
TODO: this is not really specific to BMV2, it should reside somewhere else.
This file has common data structures used for inlining functions and actions. Inlining these is simpler than inlining controls and parsers
A cstring is a reference to a zero-terminated, immutable, interned string. The cstring object itself is not immutable; you can reassign it as required, and it provides a mutable interface that copies the underlying immutable string as needed.
Compared to std::string, these are the benefits that cstring provides:
- Copying and assignment are cheap. Since cstring only deals with immutable strings, these operations only involve pointer assignment.
- Comparing cstrings for equality is cheap; interning makes it possible to test for equality using a simple pointer comparison.
- The immutability of the underlying strings means that it's always safe to change a cstring, even if there are other references to it elsewhere.
- The API offers a number of handy helper methods that aren't available on std::string.
On the other hand, these are the disadvantages of using cstring:
- Because cstring deals with immutable strings, any modification requires that the complete string be copied.
- Interning has an initial cost: converting a const char*, a std::string, or a std::stringstream to a cstring requires copying it. Currently, this happens every time you perform the conversion, whether the string is already interned or not, unless the source is an std::string.
- Interned strings can never be freed, so they'll stick around for the lifetime of the program.
- The string interning cstring performs is currently not threadsafe, so you can't safely use cstrings off the main thread.
Given these tradeoffs, the general rule of thumb to follow is that you should try to convert strings to cstrings early and keep them in that form. That way, you benefit from cheaper copying, assignment, and equality testing in as many places as possible, and you avoid paying the cost of repeated conversion.
However, when you're building or mutating a string, you should use std::string. Convert to a cstring only when the string is in its final form. This ensures that you don't pay the time and space cost of interning every intermediate version of the string.
Note that cstring has implicit conversions to and from other string types. This is convenient, but in performance-sensitive code it's good to be aware that mixing the two types of strings can trigger a lot of implicit copies.
Shouldn't happen as cmake will not try to build this backend if the boost graph headers couldn't be found.
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0 Helper functions and classes for making the creation of gtest easier and their running faster. See test-bf_getst_helper.cpp for example usage.