DiagnosticPrinter: Use printAsOperand to handle anonymous values (#119491)
To avoid changing the behavior in the general case, only do this
for anonymous functions. Otherwise, we'll end up with a leading
'@' on the name, which may not be meaningful to end users.