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

A composite Object, which has a type and fields. More...

#include <Evaluator.h>

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

Public Member Functions

 ObjectValue (om::ClassLike cls, ObjectFields fields, Location loc)
 ObjectValue (om::ClassLike cls, Location loc)
om::ClassLike getClassOp () const
const auto & getFields () const
void setFields (llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > newFields)
om::ClassType getObjectType () const
 Return the type of the value, which is a ClassType.
Type getType () const
FailureOr< EvaluatorValuePtr > getField (StringAttr field)
 Get a field of the Object by name.
FailureOr< EvaluatorValuePtr > getField (StringRef field)
ArrayAttr getFieldNames ()
 Get all the field names of the Object.
Public Member Functions inherited from circt::om::evaluator::EvaluatorValue
 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)

Static Public Member Functions

static bool classof (const EvaluatorValue *e)
 Implement LLVM RTTI.

Private Attributes

om::ClassLike cls
llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > fields

Additional Inherited Members

Public Types inherited from circt::om::evaluator::EvaluatorValue
enum class  Kind {
  Attr , Object , List , BasePath ,
  Path
}

Detailed Description

A composite Object, which has a type and fields.

Definition at line 183 of file Evaluator.h.

Constructor & Destructor Documentation

◆ ObjectValue() [1/2]

◆ ObjectValue() [2/2]

circt::om::evaluator::ObjectValue::ObjectValue ( om::ClassLike cls,
Location loc )
inline

Member Function Documentation

◆ classof()

bool circt::om::evaluator::ObjectValue::classof ( const EvaluatorValue * e)
inlinestatic

◆ getClassOp()

om::ClassLike circt::om::evaluator::ObjectValue::getClassOp ( ) const
inline

Definition at line 195 of file Evaluator.h.

References cls.

◆ getField() [1/2]

FailureOr< EvaluatorValuePtr > circt::om::evaluator::ObjectValue::getField ( StringAttr field)

Get a field of the Object by name.

Definition at line 915 of file Evaluator.cpp.

References cls, fields, and success().

Referenced by getField().

◆ getField() [2/2]

FailureOr< EvaluatorValuePtr > circt::om::evaluator::ObjectValue::getField ( StringRef field)
inline

Definition at line 219 of file Evaluator.h.

References circt::om::evaluator::EvaluatorValue::getContext(), and getField().

◆ getFieldNames()

ArrayAttr circt::om::Object::getFieldNames ( )

Get all the field names of the Object.

Get an ArrayAttr with the names of the fields in the Object.

Sort the fields so there is always a stable order.

Definition at line 924 of file Evaluator.cpp.

References cls, and fields.

◆ getFields()

const auto & circt::om::evaluator::ObjectValue::getFields ( ) const
inline

Definition at line 196 of file Evaluator.h.

References fields.

◆ getObjectType()

om::ClassType circt::om::evaluator::ObjectValue::getObjectType ( ) const
inline

Return the type of the value, which is a ClassType.

Definition at line 204 of file Evaluator.h.

References cls.

Referenced by getType().

◆ getType()

Type circt::om::evaluator::ObjectValue::getType ( ) const
inline

Definition at line 210 of file Evaluator.h.

References getObjectType().

◆ setFields()

void circt::om::evaluator::ObjectValue::setFields ( llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > newFields)
inline

Member Data Documentation

◆ cls

om::ClassLike circt::om::evaluator::ObjectValue::cls
private

◆ fields


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