
Public Member Functions | |
| MidEnd (const CompilerOptions &) | |
| void | addDefaultPasses () |
| P4::ReferenceMap * | getRefMap () |
| Retrieve the reference map used in the mid end. | |
| P4::TypeMap * | getTypeMap () |
| Retrieve the type map used in the mid end. | |
Protected Member Functions | |
| virtual bool | localCopyPropPolicy (const Visitor::Context *ctx, const IR::Expression *expr) |
| virtual Visitor * | mkConvertEnums () |
| virtual P4::ChooseEnumRepresentation * | mkConvertEnumsPolicy () |
| virtual P4::ChooseErrorRepresentation * | mkConvertErrorPolicy () |
| virtual Visitor * | mkConvertErrors () |
| virtual Visitor * | mkConvertKeys () |
| Provides a target-specific pass that simplifies keys in table calls under a custom policy. | |
Protected Attributes | |
| P4::ReferenceMap | refMap |
| P4::TypeMap | typeMap |
Implements a generic mid end for all targets. If needed, targets can customize this to implement things like targets-specific conversion of P4 enums to bit<n>.
Mid-end implementations must establish certain invariants in the IR.
TODO: Document these invariants. So far, we have:
| void P4Tools::MidEnd::addDefaultPasses | ( | ) |
Add the list of default passes to the mid end. This is not part of the initializer because some targets may add their own passes to the beginning of the pass list.
|
protectedvirtual |
Provides a target-specific policy for determining when to do local copy propagation. Implementations should return @false if local copy propagation should not be performed on the given expression. The default implementation enables local copy propagation everywhere by always returning @true.
|
protectedvirtual |
Provides a target-specific pass that converts P4 enums to bit<n>. The default implementation returns P4::ConvertEnums, instantiated with the policy provided by @mkChooseEnumRepresentation.
|
protectedvirtual |
Provides a target-specific policy for converting P4 enums to bit<n>. The default implementation converts all enums to bit<32>.
Implements the default enum-conversion policy, which converts all enums to bit<32>.
|
protectedvirtual |
Provides a target-specific policy for converting P4 error to bit<n>. The default implementation converts all errors to bit<32>.
Implements the default enum-conversion policy, which converts all enums to bit<32>.
|
protectedvirtual |
Provides a target-specific pass that converts P4 errors to bit<n>. The default implementation returns P4Tools::ConvertErrors, instantiated with the policy provided by @mkChooseEnumRepresentation.