Hello,
I'd like to get some feedback about making various function type APIs not default the ExtInfo parameter. For example:
@@ -3231,7 +3231,7 @@ class FunctionType final
public:
/// 'Constructor' Factory Function
static FunctionType *get(ArrayRef<Param> params, Type result,
- ExtInfo info = ExtInfo());
+ ExtInfo info);
// Retrieve the input parameters of this function type.
ArrayRef<Param> getParams() const {
In my experience with a downstream branch which has additional ExtInfo state, it's hard not to notice how often the compiler unpacks and rebuilds function types. It's also hard not to notice how haphazard ExtInfo propagation/preservation is as function types are unpacked and rebuilt.
Ideally, I'd like the propagation/preservation logic to be more explicit or at least have better comments. I.e. "Why are some ExtInfo bits dropped and others preserved?" But for for now, I'd just settle for ExtInfo not being defaulted so at least people get a reminder to think about the ExtInfo bits as they unpack and rebuild a function type.
What do people think?
Dave