|
CIRCT 24.0.0git
|
An Evaluator, which is constructed with an IR module and can instantiate Objects. More...
#include <Evaluator.h>

Classes | |
| struct | DebugNesting |
| RAII helper to increment/decrement debugNesting. More... | |
Public Types | |
| using | ActualParameters = ArrayRef<EvaluatorValuePtr> |
Public Member Functions | |
| Evaluator (ModuleOp mod) | |
| Construct an Evaluator with an IR module. | |
| FailureOr< evaluator::EvaluatorValuePtr > | instantiate (StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams) |
| Instantiate an Object with its class name and actual parameters. | |
| mlir::ModuleOp | getModule () |
| Get the Module this Evaluator is built from. | |
| FailureOr< evaluator::EvaluatorValuePtr > | getPartiallyEvaluatedValue (Type type, Location loc) |
Private Member Functions | |
| FailureOr< evaluator::EvaluatorValuePtr > | instantiateImpl (StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams) |
| FailureOr< EvaluatorValuePtr > | getOrCreateValue (Value value, ActualParameters actualParams, Location loc) |
| FailureOr< EvaluatorValuePtr > | evaluateValue (Value value, ActualParameters actualParams, Location loc) |
| Evaluate a Value in a Class body according to the small expression grammar described in the rationale document. | |
| FailureOr< EvaluatorValuePtr > | evaluateParameter (BlockArgument formalParam, ActualParameters actualParams, Location loc) |
| Evaluator dispatch functions for the small expression grammar. | |
| FailureOr< EvaluatorValuePtr > | evaluateConstant (ConstantOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for constants. | |
| FailureOr< EvaluatorValuePtr > | evaluateObjectInstance (StringAttr className, ActualParameters actualParams, Location loc) |
| Instantiate an Object with its class name and actual parameters. | |
| FailureOr< EvaluatorValuePtr > | evaluateElaboratedObject (ElaboratedObjectOp op, ActualParameters actualParams, Location loc) |
| FailureOr< EvaluatorValuePtr > | evaluateCollectionCreate (Operation *op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for list and registry creation. | |
| FailureOr< EvaluatorValuePtr > | evaluateListConcat (ListConcatOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for List concatenation. | |
| FailureOr< EvaluatorValuePtr > | evaluateOptionCreate (OptionCreateOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluateBasePathCreate (FrozenBasePathCreateOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluatePathCreate (FrozenPathCreateOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluateEmptyPath (FrozenEmptyPathOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluateUnknownValue (UnknownValueOp op, Location loc) |
| Evaluate an unknown value. | |
| FailureOr< evaluator::EvaluatorValuePtr > | createUnknownValue (Type type, Location loc) |
| Create an unknown value of the specified type. | |
| raw_ostream & | dbgs (unsigned extra=0) |
| llvm::indent | indent (unsigned extra=0) |
Private Attributes | |
| SymbolTable | symbolTable |
| The symbol table for the IR module the Evaluator was constructed with. | |
| DenseMap< Value, std::shared_ptr< evaluator::EvaluatorValue > > | objects |
| Evaluator value storage for the current instantiation. | |
| unsigned | debugNesting = 0 |
| Current nesting depth for debug output indentation. | |
An Evaluator, which is constructed with an IR module and can instantiate Objects.
Further refinement is expected.
Definition at line 343 of file Evaluator.h.
| using circt::om::Evaluator::ActualParameters = ArrayRef<EvaluatorValuePtr> |
Definition at line 358 of file Evaluator.h.
| circt::om::Evaluator::Evaluator | ( | ModuleOp | mod | ) |
Construct an Evaluator with an IR module.
Definition at line 384 of file Evaluator.cpp.
References symbolTable.
|
private |
Create an unknown value of the specified type.
Definition at line 952 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::get(), circt::om::evaluator::PathValue::getEmptyPath(), success(), and symbolTable.
Referenced by evaluateUnknownValue().
|
inlineprivate |
Definition at line 430 of file Evaluator.h.
References debugNesting.
Referenced by evaluateObjectInstance(), evaluateValue(), getOrCreateValue(), and instantiateImpl().
|
private |
Definition at line 897 of file Evaluator.cpp.
References evaluateValue(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch function for list and registry creation.
Definition at line 801 of file Evaluator.cpp.
References evaluateValue(), failure(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch function for constants.
Definition at line 749 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::get(), and success().
Referenced by evaluateValue(), and getOrCreateValue().
|
private |
Definition at line 757 of file Evaluator.cpp.
References failure(), getOrCreateValue(), and symbolTable.
Referenced by evaluateValue().
|
private |
Definition at line 944 of file Evaluator.cpp.
References getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch function for List concatenation.
Definition at line 837 of file Evaluator.cpp.
References evaluateValue(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Instantiate an Object with its class name and actual parameters.
Definition at line 523 of file Evaluator.cpp.
References assert(), context, dbgs(), debugNesting, evaluateValue(), failure(), getOrCreateValue(), indent(), and symbolTable.
Referenced by instantiateImpl().
|
private |
Definition at line 875 of file Evaluator.cpp.
References failure(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch functions for the small expression grammar.
Evaluator dispatch function for parameters.
Definition at line 740 of file Evaluator.cpp.
References success().
Referenced by evaluateValue(), and getOrCreateValue().
|
private |
Definition at line 921 of file Evaluator.cpp.
References evaluateValue(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluate an unknown value.
Definition at line 1000 of file Evaluator.cpp.
References createUnknownValue().
Referenced by evaluateValue(), and getOrCreateValue().
|
private |
Evaluate a Value in a Class body according to the small expression grammar described in the rationale document.
The actual parameters are the values supplied at the current instantiation of the Class being evaluated.
Definition at line 680 of file Evaluator.cpp.
References dbgs(), evaluateBasePathCreate(), evaluateCollectionCreate(), evaluateConstant(), evaluateElaboratedObject(), evaluateEmptyPath(), evaluateListConcat(), evaluateOptionCreate(), evaluateParameter(), evaluatePathCreate(), evaluateUnknownValue(), evaluateValue(), and getOrCreateValue().
Referenced by evaluateBasePathCreate(), evaluateCollectionCreate(), evaluateListConcat(), evaluateObjectInstance(), evaluatePathCreate(), and evaluateValue().
| ModuleOp circt::om::Evaluator::getModule | ( | ) |
Get the Module this Evaluator is built from.
Definition at line 387 of file Evaluator.cpp.
References symbolTable.
|
private |
Definition at line 454 of file Evaluator.cpp.
References dbgs(), evaluateConstant(), evaluateParameter(), evaluateUnknownValue(), circt::om::evaluator::PathValue::getEmptyPath(), getOrCreateValue(), getPartiallyEvaluatedValue(), objects, and success().
Referenced by evaluateBasePathCreate(), evaluateCollectionCreate(), evaluateElaboratedObject(), evaluateEmptyPath(), evaluateListConcat(), evaluateObjectInstance(), evaluateOptionCreate(), evaluatePathCreate(), evaluateValue(), and getOrCreateValue().
| FailureOr< evaluator::EvaluatorValuePtr > circt::om::Evaluator::getPartiallyEvaluatedValue | ( | Type | type, |
| Location | loc ) |
Definition at line 414 of file Evaluator.cpp.
References failure(), circt::om::evaluator::AttributeValue::get(), getRuntimeType(), success(), and symbolTable.
Referenced by getOrCreateValue().
|
inlineprivate |
Definition at line 434 of file Evaluator.h.
References debugNesting.
Referenced by evaluateObjectInstance().
| FailureOr< evaluator::EvaluatorValuePtr > circt::om::Evaluator::instantiate | ( | StringAttr | className, |
| ArrayRef< EvaluatorValuePtr > | actualParams ) |
Instantiate an Object with its class name and actual parameters.
Referenced by omEvaluatorInstantiate().
|
private |
Definition at line 649 of file Evaluator.cpp.
References dbgs(), evaluateObjectInstance(), failure(), and symbolTable.
|
private |
Current nesting depth for debug output indentation.
Definition at line 421 of file Evaluator.h.
Referenced by dbgs(), evaluateObjectInstance(), and indent().
|
private |
Evaluator value storage for the current instantiation.
Definition at line 417 of file Evaluator.h.
Referenced by getOrCreateValue().
|
private |
The symbol table for the IR module the Evaluator was constructed with.
Used to look up class definitions.
Definition at line 414 of file Evaluator.h.
Referenced by createUnknownValue(), evaluateElaboratedObject(), evaluateObjectInstance(), Evaluator(), getModule(), getPartiallyEvaluatedValue(), and instantiateImpl().