|
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 > | evaluateListCreate (ListCreateOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for List creation. | |
| FailureOr< EvaluatorValuePtr > | evaluateListConcat (ListConcatOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for List concatenation. | |
| 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 300 of file Evaluator.h.
| using circt::om::Evaluator::ActualParameters = ArrayRef<EvaluatorValuePtr> |
Definition at line 315 of file Evaluator.h.
| circt::om::Evaluator::Evaluator | ( | ModuleOp | mod | ) |
Construct an Evaluator with an IR module.
Definition at line 330 of file Evaluator.cpp.
References symbolTable.
|
private |
Create an unknown value of the specified type.
Definition at line 860 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 384 of file Evaluator.h.
References debugNesting.
Referenced by evaluateObjectInstance(), evaluateValue(), getOrCreateValue(), and instantiateImpl().
|
private |
Definition at line 805 of file Evaluator.cpp.
References evaluateValue(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch function for constants.
Definition at line 682 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::get(), and success().
Referenced by evaluateValue(), and getOrCreateValue().
|
private |
Definition at line 690 of file Evaluator.cpp.
References failure(), getOrCreateValue(), and symbolTable.
Referenced by evaluateValue().
|
private |
Definition at line 852 of file Evaluator.cpp.
References getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch function for List concatenation.
Definition at line 766 of file Evaluator.cpp.
References evaluateValue(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluator dispatch function for List creation.
Definition at line 732 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 461 of file Evaluator.cpp.
References assert(), context, dbgs(), debugNesting, evaluateValue(), failure(), getOrCreateValue(), indent(), and symbolTable.
Referenced by instantiateImpl().
|
private |
Evaluator dispatch functions for the small expression grammar.
Evaluator dispatch function for parameters.
Definition at line 673 of file Evaluator.cpp.
References success().
Referenced by evaluateValue(), and getOrCreateValue().
|
private |
Definition at line 829 of file Evaluator.cpp.
References evaluateValue(), and getOrCreateValue().
Referenced by evaluateValue().
|
private |
Evaluate an unknown value.
Definition at line 905 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 618 of file Evaluator.cpp.
References dbgs(), evaluateBasePathCreate(), evaluateConstant(), evaluateElaboratedObject(), evaluateEmptyPath(), evaluateListConcat(), evaluateListCreate(), evaluateParameter(), evaluatePathCreate(), evaluateUnknownValue(), evaluateValue(), and getOrCreateValue().
Referenced by evaluateBasePathCreate(), evaluateListConcat(), evaluateListCreate(), evaluateObjectInstance(), evaluatePathCreate(), and evaluateValue().
| ModuleOp circt::om::Evaluator::getModule | ( | ) |
Get the Module this Evaluator is built from.
Definition at line 333 of file Evaluator.cpp.
References symbolTable.
|
private |
Definition at line 393 of file Evaluator.cpp.
References dbgs(), evaluateConstant(), evaluateParameter(), evaluateUnknownValue(), circt::om::evaluator::PathValue::getEmptyPath(), getOrCreateValue(), getPartiallyEvaluatedValue(), objects, and success().
Referenced by evaluateBasePathCreate(), evaluateElaboratedObject(), evaluateEmptyPath(), evaluateListConcat(), evaluateListCreate(), evaluateObjectInstance(), evaluatePathCreate(), evaluateValue(), and getOrCreateValue().
| FailureOr< evaluator::EvaluatorValuePtr > circt::om::Evaluator::getPartiallyEvaluatedValue | ( | Type | type, |
| Location | loc ) |
Definition at line 359 of file Evaluator.cpp.
References failure(), circt::om::evaluator::AttributeValue::get(), success(), and symbolTable.
Referenced by getOrCreateValue().
|
inlineprivate |
Definition at line 388 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 587 of file Evaluator.cpp.
References dbgs(), evaluateObjectInstance(), failure(), and symbolTable.
|
private |
Current nesting depth for debug output indentation.
Definition at line 375 of file Evaluator.h.
Referenced by dbgs(), evaluateObjectInstance(), and indent().
|
private |
Evaluator value storage for the current instantiation.
Definition at line 371 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 368 of file Evaluator.h.
Referenced by createUnknownValue(), evaluateElaboratedObject(), evaluateObjectInstance(), Evaluator(), getModule(), getPartiallyEvaluatedValue(), and instantiateImpl().