P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::P4Smith::P4Scope Class Reference

Static Public Member Functions

static void addLval (const IR::Type *tp, cstring name, bool read_only=false)
 
static void addToScope (const IR::Node *n)
 
static bool checkLval (const IR::Type *tp, bool must_write=false)
 
static void deleteLval (const IR::Type *tp, cstring name)
 
static void endLocalScope ()
 
static std::set< const IR::P4Table * > * getCallableTables ()
 
static std::set< cstringgetCandidateLvals (const IR::Type *tp, bool must_write=true)
 
template<typename T >
static std::vector< const T * > getDecls ()
 
static std::vector< const IR::Type_Declaration * > getFilteredDecls (std::set< cstring > filter)
 
static const IR::Type_Declaration * getTypeByName (cstring name)
 
static std::optional< std::map< int, std::set< cstring > > > getWriteableLvalForTypeKey (cstring typeKey)
 
static bool hasWriteableLval (cstring typeKey)
 
static const IR::Type_Bits * pickDeclaredBitType (bool must_write=false)
 
static cstring pickLval (const IR::Type *tp, bool must_write=false)
 
static void startLocalScope ()
 

Static Public Attributes

static std::set< const IR::P4Table * > callableTables
 
static Constraints constraints
 This defines all constraints specific to various targets or back-ends.
 
static std::map< cstring, std::map< int, std::set< cstring > > > lvalMap
 This is a map of usable lvalues we store to be used for references.
 
static std::map< cstring, std::map< int, std::set< cstring > > > lvalMapRw
 A subset of the lval map that includes rw values.
 
static std::set< cstringnotInitializedStructs
 Structs that should not be initialized because they are incomplete.
 
static Properties prop
 
static Requirements req
 Back-end or node-specific restrictions.
 
static std::vector< IR::Vector< IR::Node > * > scope = std::vector<IR::Vector<IR::Node> *>()
 This is a list of subscopes.
 
static std::set< cstringusedNames
 Maintain a set of names we have already used to avoid duplicates.
 

Member Data Documentation

◆ callableTables

std::set< const IR::P4Table * > P4::P4Tools::P4Smith::P4Scope::callableTables
static

TODO: Maybe we can just remove tables from the declarations list? This is back-end specific.

◆ prop

Properties P4::P4Tools::P4Smith::P4Scope::prop
static

Properties that define the current state of the program. For example, when should a return expression must be returned in a block.