CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::om::evaluator::EvaluatorValue Class Reference

Base class for evaluator runtime values. More...

#include <Evaluator.h>

Inheritance diagram for circt::om::evaluator::EvaluatorValue:
Collaboration diagram for circt::om::evaluator::EvaluatorValue:

Public Types

enum class  Kind {
  Attr , Object , List , BasePath ,
  Path
}

Public Member Functions

 EvaluatorValue (MLIRContext *ctx, Kind kind, Location loc)
Kind getKind () const
MLIRContext * getContext () const
bool isFullyEvaluated () const
void markFullyEvaluated ()
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
Location getLoc () const
void setLoc (Location l)
void setLocIfUnknown (Location l)

Private Attributes

const Kind kind
MLIRContext * ctx
Location loc
bool fullyEvaluated = false
bool unknown = false

Detailed Description

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 47 of file Evaluator.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Attr 
Object 
List 
BasePath 
Path 

Definition at line 50 of file Evaluator.h.

Constructor & Destructor Documentation

◆ EvaluatorValue()

Member Function Documentation

◆ getContext() [1/2]

MLIRContext * circt::om::evaluator::EvaluatorValue::getContext ( )
inline

Return the associated MLIR context.

Definition at line 80 of file Evaluator.h.

References ctx.

◆ getContext() [2/2]

◆ getKind()

◆ getLoc()

Location circt::om::evaluator::EvaluatorValue::getLoc ( ) const
inline

Definition at line 86 of file Evaluator.h.

References loc.

◆ getType()

Type circt::om::evaluator::EvaluatorValue::getType ( ) const

Definition at line 347 of file Evaluator.cpp.

References ctx.

◆ isFullyEvaluated()

bool circt::om::evaluator::EvaluatorValue::isFullyEvaluated ( ) const
inline

◆ isUnknown()

bool circt::om::evaluator::EvaluatorValue::isUnknown ( ) const
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 67 of file Evaluator.h.

References unknown.

Referenced by circt::om::operator<<().

◆ markFullyEvaluated()

◆ markUnknown()

void circt::om::evaluator::EvaluatorValue::markUnknown ( )
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 73 of file Evaluator.h.

References fullyEvaluated, markFullyEvaluated(), and unknown.

◆ setLoc()

void circt::om::evaluator::EvaluatorValue::setLoc ( Location l)
inline

Definition at line 88 of file Evaluator.h.

References loc.

◆ setLocIfUnknown()

void circt::om::evaluator::EvaluatorValue::setLocIfUnknown ( Location l)
inline

Definition at line 90 of file Evaluator.h.

References loc.

Member Data Documentation

◆ ctx

MLIRContext* circt::om::evaluator::EvaluatorValue::ctx
private

Definition at line 97 of file Evaluator.h.

Referenced by EvaluatorValue(), getContext(), getContext(), and getType().

◆ fullyEvaluated

bool circt::om::evaluator::EvaluatorValue::fullyEvaluated = false
private

Definition at line 99 of file Evaluator.h.

Referenced by isFullyEvaluated(), markFullyEvaluated(), and markUnknown().

◆ kind

const Kind circt::om::evaluator::EvaluatorValue::kind
private

Definition at line 96 of file Evaluator.h.

Referenced by EvaluatorValue(), and getKind().

◆ loc

◆ unknown

bool circt::om::evaluator::EvaluatorValue::unknown = false
private

Definition at line 100 of file Evaluator.h.

Referenced by isUnknown(), and markUnknown().


The documentation for this class was generated from the following files: