CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for circt::om::evaluator::ObjectValue:
Collaboration graph
[legend]

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< EvaluatorValuePtrgetField (StringAttr field)
 Get a field of the Object by name.
 
FailureOr< EvaluatorValuePtrgetField (StringRef field)
 
ArrayAttr getFieldNames ()
 Get all the field names of the Object.
 
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 ()
 
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)
 

Static Public Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

A composite Object, which has a type and fields.

Definition at line 249 of file Evaluator.h.

Constructor & Destructor Documentation

◆ ObjectValue() [1/2]

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

◆ ObjectValue() [2/2]

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

Definition at line 258 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 279 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 808 of file Evaluator.cpp.

◆ getClassOp()

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

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

Referenced by getField().

◆ getField() [2/2]

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

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

◆ getFields()

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

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

References cls.

Referenced by getType().

◆ getType()

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

Definition at line 276 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

Definition at line 296 of file Evaluator.h.

Referenced by getClassOp(), and getObjectType().

◆ fields

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

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