|
|
void | clear () |
| |
|
const ordered_set< const loc_t * > & | getDefs (const IR::Node *n) const |
| |
|
const ordered_set< const loc_t * > & | getUses (const IR::Node *n) const |
| |
| const IR::IDeclaration * | getDeclaration (const IR::Path *path, bool notNull=false) const |
| |
| const IR::IDeclaration * | getDeclaration (const IR::This *, bool notNull=false) const |
| |
|
auto | getDeclarations (const IR::INamespace *ns) const |
| | Returns the set of decls that exist in the given namespace.
|
| |
|
auto | getDeclsByName (const IR::INamespace *ns, cstring name) const |
| | Returns the set of decls with the given name that exist in the given namespace.
|
| |
|
std::vector< const IR::IDeclaration * > | resolve (const IR::ID &name, ResolutionType type) const |
| | Resolve references for name, restricted to type declarations.
|
| |
| virtual const IR::IDeclaration * | resolvePath (const IR::Path *path, bool isType) const |
| |
|
const IR::Type * | resolveType (const IR::Type *type) const |
| | Resolve a refrence to a type type.
|
| |
|
const IR::IDeclaration * | resolveUnique (const IR::ID &name, ResolutionType type, const IR::INamespace *=nullptr) const |
| | Resolve reference for name, restricted to type declarations, and expect one result.
|
| |
Compute defuse info within P4Parser and P4Control blocks in the midend.
This pass finds all uses and definitions of field/slice values in all controls and parsers in the program and stores maps of which defs reach which uses. After the pass runs, getDefs(use) will return all the definitions in the program that reach the argument use while getUses(def) will return all the uses of the given def. The returned values are sets of ComputeUseDef::loc_t objects which contain both the node that is def or use as well as the context path from the root of the IR to that node – actions that are used by mulitple tables or parser states reachable via multiple paths may have mulitple entries as a result
- Precondition
- Currently the code does not consider calls between controls or parsers, as it is expected to run after inlining when all such calls have been flattened. It could be extended to deal with the before inlining case.