Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Q: What is the type of auto? Can it be spelled explicitly or is it unspellable?
I guess the overloads should also be doxygenated? (Methods above use @copydoc).
Q: What is the type of auto? Can it be spelled explicitly or is it unspellable?
I'm sure it can be spelled. See other methods that use make_filter_range like:
iterator_range<filter_iterator<const MachineOperand *, std::function<bool(const MachineOperand &Op)>>> getDebugOperandsForReg(Register Reg) const { return MachineInstr::getDebugOperandsForReg<const MachineOperand, const MachineInstr>(this, Reg); }
But I'm not sure that spelling it out in that much detail is useful. Perhaps there is a simpler type that would work? I don't know.
I'm fine with auto here, I think this is one of the cases where auto does more good than harm. Also, std::function is not cheap while a lambda can be inlined.
I asked because I thought it could be as simple as iterator_range<const_mop_iterator> above.
@qcolombet I was planning to go back to the previous diff which used auto for the return types: https://reviews.llvm.org/D151423?vs=on&id=525565. Do you have a preference?