Moving to deduction guides instead of makeXXX

Hey folks,

Since we’re now requiring C++17, I’d like to 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.

I’ve already done the change (i.e. invoked sed) for makeArrayRef, see ⚙ D140896 [WIP] Move from llvm::makeArrayRef to ArrayRef deduction guides . The only non-automatic changes have been:

  1. Write the deduction guides
  2. 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*))
  3. 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.
  4. ADL doesn’t seem to work the same for deductio-guides and functions, so at some point the llvm namespace must be explicitly stated.
  5. The “reference mode” of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that).

Sounds great to me!

I already did a little of this here: ⚙ D139828 [AMDGPU] Stop using make_pair and make_tuple. NFC.

For the record: the move has been done through

In addition to the above changes, it’s worth noting that clang-11 has a few bugs that prevents it from using deduction guides in some situation. In that case I just used an explicit constructor call (2 occurrences).

The llvm::makeArrayRef interface has been kept and marked deprecated.