/// Return the type of this function.
FunctionType getType() { return type; }
+ /// Change the type of this function in place. This is an extremely dangerous
+ /// operation and it is up to the caller to ensure that this is legal for this
+ /// function, and to restore invariants:
+ /// - the entry block args must be updated to match the function params.
+ /// - the arguments attributes may need an update: if the new type has less
+ /// parameters we drop the extra attributes, if there are more parameters
+ /// they won't have any attributes.
+ void setType(FunctionType newType) {
+ type = newType;
+ argAttrs.resize(type.getNumInputs());
+ }
+
MLIRContext *getContext();
Module *getModule() { return module; }