Adding the DW_CC_nocall calling convention to the function debug metadata is needed when either the return values or the arguments of a function are removed as this helps in informing debugger that it may not be safe to call this function or try to interpret the return value.
This translates to setting DW_AT_calling_convention with DW_CC_nocall for appropriate DWARF DIEs.
The DWARF5 spec (section 3.3.1.1 Calling Convention Information) says:
If the DW_AT_calling_convention attribute is not present, or its value is the constant DW_CC_normal, then the subroutine may be safely called by obeying the standard calling conventions of the target architecture. If the value of the calling convention attribute is the constant DW_CC_nocall, the subroutine does not obey standard calling conventions, and it may not be safe for the debugger to call this subroutine.
I think this FIXME is correct, and we should probably just check if the type matches or not. Happy for that to go into this change rather than being a separate one - and if someone figures out some needle-threading nuance where the types might mismatch but still be call-compatible, they can add that back in later.