|
CIRCT 23.0.0git
|
Base class for evaluator runtime values. More...
#include <Evaluator.h>


Public Types | |
| enum class | Kind { Attr , Object , List , Reference , BasePath , Path } |
Public Member Functions | |
| EvaluatorValue (MLIRContext *ctx, Kind kind, Location loc) | |
| Kind | getKind () const |
| MLIRContext * | getContext () const |
| bool | isFullyEvaluated () const |
| void | markFullyEvaluated () |
| void | setFullyEvaluatedCounter (uint64_t *counter) |
| Set a counter to increment when this value becomes fully evaluated. | |
| bool | isUnknown () const |
| Return true if the value is unknown (has unknown in its fan-in). | |
| void | markUnknown () |
| Mark this value as unknown. | |
| MLIRContext * | getContext () |
| Return the associated MLIR context. | |
| Type | getType () const |
| LogicalResult | finalize () |
| Location | getLoc () const |
| void | setLoc (Location l) |
| void | setLocIfUnknown (Location l) |
Private Attributes | |
| const Kind | kind |
| MLIRContext * | ctx |
| Location | loc |
| bool | fullyEvaluated = false |
| bool | finalized = false |
| bool | unknown = false |
| uint64_t * | fullyEvaluatedCounter = nullptr |
Base class for evaluator runtime values.
Enables the shared_from_this functionality so Evaluator Value pointers can be passed through the CAPI and unwrapped back into C++ smart pointers with the appropriate reference count.
Definition at line 49 of file Evaluator.h.
|
strong |
| Enumerator | |
|---|---|
| Attr | |
| Object | |
| List | |
| Reference | |
| BasePath | |
| Path | |
Definition at line 52 of file Evaluator.h.
|
inline |
Definition at line 53 of file Evaluator.h.
| LogicalResult circt::om::evaluator::EvaluatorValue::finalize | ( | ) |
Definition at line 339 of file Evaluator.cpp.
References assert().
|
inline |
|
inline |
Definition at line 56 of file Evaluator.h.
References ctx.
Referenced by circt::om::evaluator::ObjectValue::getField(), and circt::om::operator<<().
|
inline |
Definition at line 55 of file Evaluator.h.
References kind.
Referenced by circt::om::evaluator::ReferenceValue::classof(), circt::om::evaluator::AttributeValue::classof(), circt::om::evaluator::ListValue::classof(), circt::om::evaluator::ObjectValue::classof(), circt::om::evaluator::BasePathValue::classof(), and circt::om::evaluator::PathValue::classof().
|
inline |
Definition at line 99 of file Evaluator.h.
References loc.
| Type circt::om::evaluator::EvaluatorValue::getType | ( | ) | const |
Definition at line 352 of file Evaluator.cpp.
|
inline |
Definition at line 60 of file Evaluator.h.
References fullyEvaluated.
Referenced by circt::om::Evaluator::evaluateListConcat().
|
inline |
Return true if the value is unknown (has unknown in its fan-in).
A value is unknown if it depends on an UnknownValueOp or if any of its inputs are unknown. Unknown values propagate through operations.
Definition at line 77 of file Evaluator.h.
References unknown.
Referenced by circt::om::operator<<().
|
inline |
Definition at line 61 of file Evaluator.h.
References assert(), fullyEvaluated, and fullyEvaluatedCounter.
Referenced by circt::om::evaluator::AttributeValue::AttributeValue(), circt::om::evaluator::PathValue::getEmptyPath(), circt::om::evaluator::ListValue::ListValue(), markUnknown(), circt::om::evaluator::ObjectValue::ObjectValue(), circt::om::evaluator::ListValue::setElements(), circt::om::evaluator::ObjectValue::setFields(), and circt::om::evaluator::ReferenceValue::setValue().
|
inline |
Mark this value as unknown.
This also marks the value as fully evaluated if it isn't already, since unknown values are considered fully evaluated. This maintains the invariant that unknown implies fullyEvaluated.
Definition at line 83 of file Evaluator.h.
References fullyEvaluated, markFullyEvaluated(), and unknown.
|
inline |
Set a counter to increment when this value becomes fully evaluated.
Definition at line 70 of file Evaluator.h.
References fullyEvaluatedCounter.
|
inline |
Definition at line 101 of file Evaluator.h.
References loc.
|
inline |
Definition at line 103 of file Evaluator.h.
References loc.
|
private |
Definition at line 110 of file Evaluator.h.
Referenced by getContext(), and getContext().
|
private |
Definition at line 113 of file Evaluator.h.
|
private |
Definition at line 112 of file Evaluator.h.
Referenced by isFullyEvaluated(), markFullyEvaluated(), and markUnknown().
|
private |
Definition at line 115 of file Evaluator.h.
Referenced by markFullyEvaluated(), and setFullyEvaluatedCounter().
|
private |
Definition at line 109 of file Evaluator.h.
Referenced by getKind().
|
private |
Definition at line 111 of file Evaluator.h.
Referenced by getLoc(), setLoc(), and setLocIfUnknown().
|
private |
Definition at line 114 of file Evaluator.h.
Referenced by isUnknown(), and markUnknown().