CIRCT 24.0.0git
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
circt::om::evaluator::EvaluatorValue Class Reference

Base class for evaluator runtime values. More...

#include <Evaluator.h>

Inheritance diagram for circt::om::evaluator::EvaluatorValue:
Inheritance graph
[legend]
Collaboration diagram for circt::om::evaluator::EvaluatorValue:
Collaboration graph
[legend]

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()

circt::om::evaluator::EvaluatorValue::EvaluatorValue ( MLIRContext *  ctx,
Kind  kind,
Location  loc 
)
inline

Definition at line 51 of file Evaluator.h.

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]

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

Definition at line 54 of file Evaluator.h.

References ctx.

Referenced by circt::om::evaluator::ObjectValue::getField(), and circt::om::operator<<().

◆ getKind()

Kind circt::om::evaluator::EvaluatorValue::getKind ( ) const
inline

◆ 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 334 of file Evaluator.cpp.

◆ isFullyEvaluated()

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

Definition at line 58 of file Evaluator.h.

References fullyEvaluated.

◆ 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()

void circt::om::evaluator::EvaluatorValue::markFullyEvaluated ( )
inline

◆ 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 getContext(), and getContext().

◆ 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 getKind().

◆ loc

Location circt::om::evaluator::EvaluatorValue::loc
private

Definition at line 98 of file Evaluator.h.

Referenced by getLoc(), setLoc(), and setLocIfUnknown().

◆ 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: