CIRCT 23.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 , Reference ,
  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
 
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
 

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

Member Enumeration Documentation

◆ Kind

Enumerator
Attr 
Object 
List 
Reference 
BasePath 
Path 

Definition at line 51 of file Evaluator.h.

Constructor & Destructor Documentation

◆ EvaluatorValue()

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

Definition at line 52 of file Evaluator.h.

Member Function Documentation

◆ finalize()

LogicalResult circt::om::evaluator::EvaluatorValue::finalize ( )

Definition at line 44 of file Evaluator.cpp.

References assert().

◆ getContext() [1/2]

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

Return the associated MLIR context.

Definition at line 81 of file Evaluator.h.

References ctx.

◆ getContext() [2/2]

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

Definition at line 55 of file Evaluator.h.

References ctx.

Referenced by circt::om::evaluator::ObjectValue::getField().

◆ getKind()

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

◆ getLoc()

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

Definition at line 90 of file Evaluator.h.

References loc.

◆ getType()

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

Definition at line 57 of file Evaluator.cpp.

◆ isFullyEvaluated()

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

Definition at line 59 of file Evaluator.h.

References fullyEvaluated.

Referenced by circt::om::Evaluator::evaluateListConcat().

◆ 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 68 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 74 of file Evaluator.h.

References fullyEvaluated, markFullyEvaluated(), and unknown.

◆ setLoc()

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

Definition at line 92 of file Evaluator.h.

References loc.

◆ setLocIfUnknown()

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

Definition at line 94 of file Evaluator.h.

References loc.

Member Data Documentation

◆ ctx

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

Definition at line 101 of file Evaluator.h.

Referenced by getContext(), and getContext().

◆ finalized

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

Definition at line 104 of file Evaluator.h.

◆ fullyEvaluated

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

Definition at line 103 of file Evaluator.h.

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

◆ kind

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

Definition at line 100 of file Evaluator.h.

Referenced by getKind().

◆ loc

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

Definition at line 102 of file Evaluator.h.

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

◆ unknown

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

Definition at line 105 of file Evaluator.h.

Referenced by isUnknown(), and markUnknown().


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