CIRCT
20.0.0git
|
This class provides a read-only projection of an annotation. More...
#include <FIRRTLAnnotations.h>
Classes | |
struct | ClassIsa |
Helper struct to perform variadic class equality check. More... | |
Public Types | |
using | iterator = llvm::ArrayRef< NamedAttribute >::iterator |
Public Member Functions | |
Annotation ()=default | |
Annotation (Attribute attr) | |
Annotation (Annotation anno, uint64_t fieldID) | |
DictionaryAttr | getDict () const |
Get the data dictionary of this attribute. More... | |
void | setDict (DictionaryAttr dict) |
Set the data dictionary of this attribute. More... | |
unsigned | getFieldID () const |
Get the field id this attribute targets. More... | |
Attribute | getAttr () const |
Get the underlying attribute. More... | |
StringAttr | getClassAttr () const |
Return the 'class' that this annotation is representing. More... | |
StringRef | getClass () const |
Return the 'class' that this annotation is representing. More... | |
template<typename... Args> | |
bool | isClass (Args... names) const |
Return true if this annotation matches any of the specified class names. More... | |
template<typename AttrClass = Attribute> | |
AttrClass | getMember (StringAttr name) const |
Return a member of the annotation. More... | |
template<typename AttrClass = Attribute> | |
AttrClass | getMember (StringRef name) const |
void | setMember (StringAttr name, Attribute value) |
Add or set a member of the annotation to a value. More... | |
void | setMember (StringRef name, Attribute value) |
void | removeMember (StringAttr name) |
Remove a member of the annotation. More... | |
void | removeMember (StringRef name) |
bool | canBeDeleted () |
Returns true if this is an annotation which can be safely deleted without consequence. More... | |
iterator | begin () const |
iterator | end () const |
bool | operator== (const Annotation &other) const |
bool | operator!= (const Annotation &other) const |
operator bool () const | |
bool | operator! () const |
void | dump () |
Private Attributes | |
Attribute | attr |
This class provides a read-only projection of an annotation.
Definition at line 51 of file FIRRTLAnnotations.h.
using circt::firrtl::Annotation::iterator = llvm::ArrayRef<NamedAttribute>::iterator |
Definition at line 116 of file FIRRTLAnnotations.h.
|
default |
|
inlineexplicit |
Definition at line 55 of file FIRRTLAnnotations.h.
|
inline |
Definition at line 60 of file FIRRTLAnnotations.h.
References attr, circt::calyx::direction::get(), getMember(), removeMember(), and setMember().
|
inline |
Definition at line 117 of file FIRRTLAnnotations.h.
References getDict().
Referenced by Deduper::makeAnnotationNonLocal().
bool Annotation::canBeDeleted | ( | ) |
Returns true if this is an annotation which can be safely deleted without consequence.
Definition at line 441 of file FIRRTLAnnotations.cpp.
References isClass(), and circt::firrtl::omirTrackerAnnoClass.
Referenced by circt::firrtl::AnnotationSet::canBeDeleted().
void Annotation::dump | ( | ) |
Definition at line 453 of file FIRRTLAnnotations.cpp.
References attr.
|
inline |
Definition at line 118 of file FIRRTLAnnotations.h.
References getDict().
Referenced by Deduper::makeAnnotationNonLocal().
|
inline |
Get the underlying attribute.
Definition at line 82 of file FIRRTLAnnotations.h.
References attr.
Referenced by llvm::PointerLikeTypeTraits< circt::firrtl::Annotation >::getAsVoidPointer(), and llvm::DenseMapInfo< circt::firrtl::Annotation >::getHashValue().
StringRef Annotation::getClass | ( | ) | const |
Return the 'class' that this annotation is representing.
Definition at line 373 of file FIRRTLAnnotations.cpp.
References getClassAttr().
Referenced by circt::firrtl::applyWithoutTargetImpl(), circt::firrtl::AnnotationSet::removeAnnotation(), and circt::firrtl::AnnotationSet::removeAnnotations().
StringAttr Annotation::getClassAttr | ( | ) | const |
Return the 'class' that this annotation is representing.
Definition at line 368 of file FIRRTLAnnotations.cpp.
References getDict().
Referenced by getClass(), and isClass().
DictionaryAttr Annotation::getDict | ( | ) | const |
Get the data dictionary of this attribute.
Definition at line 355 of file FIRRTLAnnotations.cpp.
References attr.
Referenced by begin(), cloneMemWithNewType(), end(), getClassAttr(), getMember(), circt::firrtl::AnnotationSet::removeAnnotation(), removeMember(), and setMember().
unsigned Annotation::getFieldID | ( | ) | const |
Get the field id this attribute targets.
Definition at line 361 of file FIRRTLAnnotations.cpp.
Referenced by cloneMemWithNewType(), and ResolveTracesPass::updateTargetImpl().
|
inline |
Return a member of the annotation.
Definition at line 96 of file FIRRTLAnnotations.h.
References getDict().
Referenced by Annotation(), circt::firrtl::applyWithoutTargetImpl(), removeAnnotationWithFilename(), ResolveTracesPass::updateModuleTarget(), and ResolveTracesPass::updateTargetImpl().
|
inline |
Definition at line 100 of file FIRRTLAnnotations.h.
References getDict().
|
inline |
Return true if this annotation matches any of the specified class names.
Definition at line 90 of file FIRRTLAnnotations.h.
References getClassAttr().
Referenced by canBeDeleted(), isAnnoInteresting(), circt::firrtl::AnnotationSet::removeAnnotationsWithClass(), removeAnnotationWithFilename(), and ResolveTracesPass::runOnOperation().
|
inlineexplicit |
Definition at line 122 of file FIRRTLAnnotations.h.
References attr.
|
inline |
Definition at line 123 of file FIRRTLAnnotations.h.
References attr.
|
inline |
Definition at line 121 of file FIRRTLAnnotations.h.
|
inline |
Definition at line 120 of file FIRRTLAnnotations.h.
References attr.
void Annotation::removeMember | ( | StringAttr | name | ) |
Remove a member of the annotation.
Definition at line 404 of file FIRRTLAnnotations.cpp.
References getDict(), and setDict().
Referenced by Annotation().
void Annotation::removeMember | ( | StringRef | name | ) |
Definition at line 421 of file FIRRTLAnnotations.cpp.
void Annotation::setDict | ( | DictionaryAttr | dict | ) |
Set the data dictionary of this attribute.
Definition at line 359 of file FIRRTLAnnotations.cpp.
References attr.
Referenced by Deduper::cloneAnnotation(), removeMember(), and setMember().
void Annotation::setMember | ( | StringAttr | name, |
Attribute | value | ||
) |
Add or set a member of the annotation to a value.
Definition at line 379 of file FIRRTLAnnotations.cpp.
Referenced by Annotation(), and cloneMemWithNewType().
void Annotation::setMember | ( | StringRef | name, |
Attribute | value | ||
) |
Definition at line 383 of file FIRRTLAnnotations.cpp.
References circt::calyx::direction::get(), getDict(), and setDict().
|
private |
Definition at line 128 of file FIRRTLAnnotations.h.
Referenced by Annotation(), dump(), getAttr(), getDict(), operator bool(), operator!(), operator==(), and setDict().