forked from OSchip/llvm-project
Add a setAttrList() method on mlir::Operation
This is an efficient method to copy attributes from one operation to another. PiperOrigin-RevId: 253806004
This commit is contained in:
parent
14e2f4a22b
commit
847e15e3c2
|
@ -257,6 +257,11 @@ public:
|
|||
/// Return the internal attribute list on this operation.
|
||||
NamedAttributeList &getAttrList() { return attrs; }
|
||||
|
||||
/// Set the attribute list on this operation.
|
||||
/// Using a NamedAttributeList is more efficient as it does not require new
|
||||
/// uniquing in the MLIRContext.
|
||||
void setAttrList(NamedAttributeList newAttrs) { attrs = newAttrs; }
|
||||
|
||||
/// Return the specified attribute if present, null otherwise.
|
||||
Attribute getAttr(Identifier name) { return attrs.get(name); }
|
||||
Attribute getAttr(StringRef name) { return attrs.get(name); }
|
||||
|
|
Loading…
Reference in New Issue