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 , Option ,
  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 itself is unknown.
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 
Option 
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 79 of file Evaluator.h.

References ctx.

◆ getContext() [2/2]

◆ getKind()

◆ getLoc()

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

Definition at line 85 of file Evaluator.h.

References loc.

◆ getType()

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

Definition at line 401 of file Evaluator.cpp.

References ctx, and circt::om::evaluator::OptionValue::getOptionType().

◆ isFullyEvaluated()

◆ isUnknown()

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

Return true if the value itself is unknown.

This does not recursively inspect object fields or container payloads.

Definition at line 66 of file Evaluator.h.

References unknown.

Referenced by circt::om::evaluator::OptionValue::hasValue(), and 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 72 of file Evaluator.h.

References fullyEvaluated, markFullyEvaluated(), and unknown.

◆ setLoc()

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

Definition at line 87 of file Evaluator.h.

References loc.

◆ setLocIfUnknown()

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

Definition at line 89 of file Evaluator.h.

References loc.

Member Data Documentation

◆ ctx

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

Definition at line 96 of file Evaluator.h.

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

◆ fullyEvaluated

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

Definition at line 98 of file Evaluator.h.

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

◆ kind

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

Definition at line 95 of file Evaluator.h.

Referenced by EvaluatorValue(), and getKind().

◆ loc

◆ unknown

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

Definition at line 99 of file Evaluator.h.

Referenced by isUnknown(), and markUnknown().


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