/// This function is used by the internals of the Function class to null out
/// attributes referring to functions that are about to be deleted.
static void dropFunctionReference(Function *value);
+
+ /// This function is used by the internals of the Function class to update the
+ /// type of the function attribute for 'value'.
+ static void resetType(Function *value);
};
/// A base attribute that represents a reference to a vector or tensor constant.
void setType(FunctionType newType) {
type = newType;
argAttrs.resize(type.getNumInputs());
+ FunctionAttr::resetType(this);
}
MLIRContext *getContext();
value = nullptr;
}
+ /// Reset the type of this attribute to the type of the held function.
+ void resetType() { setType(value->getType()); }
+
Function *value;
};
StandardAttributes::Function, value);
}
+/// This function is used by the internals of the Function class to update the
+/// type of the attribute for 'value'.
+void FunctionAttr::resetType(Function *value) {
+ FunctionAttr::get(value).getImpl()->resetType();
+}
+
Function *FunctionAttr::getValue() const { return getImpl()->value; }
FunctionType FunctionAttr::getType() const {