CIRCT  18.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
[legend]
Collaboration diagram for circt::om::evaluator::ObjectValue:
Collaboration graph
[legend]

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

Constructor & Destructor Documentation

◆ ObjectValue() [1/2]

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

◆ ObjectValue() [2/2]

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

Definition at line 253 of file Evaluator.h.

Member Function Documentation

◆ classof()

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

Implement LLVM RTTI.

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

References circt::om::evaluator::finalizeEvaluatorValue(), and value.

◆ getClassOp()

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

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

Referenced by getField().

◆ getField() [2/2]

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

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

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

◆ getFields()

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

Definition at line 257 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 265 of file Evaluator.h.

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

Referenced by getType().

◆ getType()

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

Definition at line 271 of file Evaluator.h.

References getObjectType().

◆ setFields()

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

Member Data Documentation

◆ cls

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

Definition at line 291 of file Evaluator.h.

Referenced by getClassOp(), and getObjectType().

◆ fields

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

Definition at line 292 of file Evaluator.h.

Referenced by getFields(), and setFields().


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