DwarfDebug unconditionally assumes for all call instructions the 0th
operand is the callee operand, which seems to be true for other targets,
but not for WebAssembly. This adds TargetInstrInfo::getCallOperand
method whose default implementation returns getOperand(0) and makes
WebAssembly overrides it to use its own utility method to get the callee
operand.
Edit:
This also fixes an existing bug in WebAssembly::getCalleeOp, which was
uncovered by this CL.
Without this patch this fails, because
In this wasm MIR instruction, the callee is the 1th operand, but the current code will incorrectly assume the 0th operand, which is the dest register (%5 here), as a callee, and will try to print its register name, when --debug is given. This crashes because wasm does not use physical registers.