CIRCT  19.0.0git
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
circt::om::evaluator::ObjectValue Struct Reference

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

#include <Evaluator.h>

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

Public Member Functions

 ObjectValue (om::ClassOp cls, ObjectFields fields, Location loc)
 ObjectValue (om::ClassOp cls, Location loc)
om::ClassOp 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. More...
Type getType () const
FailureOr< EvaluatorValuePtrgetField (StringAttr field)
 Get a field of the Object by name. More...
FailureOr< EvaluatorValuePtrgetField (StringRef field)
ArrayAttr getFieldNames ()
 Get all the field names of the Object. More...
LogicalResult finalizeImpl ()
- 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 ()
MLIRContext * getContext ()
 Return the associated MLIR context. More...
Type getType () const
LogicalResult finalize ()
Location getLoc () const
void setLoc (Location l)
void setLocIfUnknown (Location l)

Static Public Member Functions

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

Private Attributes

om::ClassOp cls
llvm::SmallDenseMap< StringAttr, EvaluatorValuePtrfields

Additional Inherited Members

- Public Types inherited from circt::om::evaluator::EvaluatorValue
enum class  Kind {
  Attr , Object , List , Tuple ,
  Map , Reference , BasePath , Path

Detailed Description

A composite Object, which has a type and fields.

Definition at line 257 of file Evaluator.h.

Constructor & Destructor Documentation

◆ ObjectValue() [1/2]

circt::om::evaluator::ObjectValue::ObjectValue ( om::ClassOp  cls,
ObjectFields  fields,
Location  loc 

◆ ObjectValue() [2/2]

circt::om::evaluator::ObjectValue::ObjectValue ( om::ClassOp  cls,
Location  loc 

Definition at line 265 of file Evaluator.h.

Member Function Documentation

◆ classof()

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

Implement LLVM RTTI.

Definition at line 286 of file Evaluator.h.

References circt::om::evaluator::EvaluatorValue::getKind(), and circt::om::evaluator::EvaluatorValue::Object.

◆ finalizeImpl()

LogicalResult circt::om::evaluator::ObjectValue::finalizeImpl ( )

Definition at line 711 of file Evaluator.cpp.

References circt::om::evaluator::finalizeEvaluatorValue().

◆ getClassOp()

om::ClassOp circt::om::evaluator::ObjectValue::getClassOp ( ) const

Definition at line 268 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 690 of file Evaluator.cpp.

Referenced by getField().

◆ getField() [2/2]

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

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

References circt::calyx::direction::get().

◆ getFields()

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

Definition at line 269 of file Evaluator.h.

References fields.

◆ getObjectType()

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

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

Definition at line 277 of file Evaluator.h.

References cls, and circt::calyx::direction::get().

Referenced by getType().

◆ getType()

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

Definition at line 283 of file Evaluator.h.

References getObjectType().

◆ setFields()

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

Member Data Documentation

◆ cls

om::ClassOp circt::om::evaluator::ObjectValue::cls

Definition at line 303 of file Evaluator.h.

Referenced by getClassOp(), and getObjectType().

◆ fields

llvm::SmallDenseMap<StringAttr, EvaluatorValuePtr> circt::om::evaluator::ObjectValue::fields

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