Since we're now requiring C++17, Let's get rid of makeXXX functions like makeArrayRef, and use deduction guides instead.
Apart from codebase modernization, there isn't much benefit from that
move, but I can still mention that it would slightly (probably
negligibly) decrease the number of symbols / debug info, as deduction
guides don't generate new code.
The only non-automatic changes have been:
- Write the deduction guides
- ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*))
- CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase.
- ADL doesn't seem to work the same for deductio-guides and functions, so at some point the llvm namespace must be explicitly stated.
- The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that).
Can we keep the makeArrayRef functions for now and mark them deprecated?