Fixes: https://bugs.llvm.org/show_bug.cgi?id=52552
This patch fixes an issue in which SSA value reference within a DIArgList would be unnecessarily dropped by llvm-link, even when invoking on a single file (which should be a no-op). The reason for the difference is that the ValueMapper does not refer to the RF_IgnoreMissingLocals flag for LocalAsMetadata contained within a DIArgList; this flag is used for direct LocalAsMetadata uses to preserve SSA references even when the ValueMapper does not have an explicit mapping for the referenced SSA value, which appears to always be the case when using llvm-link in this manner.
NB: There is another difference between the direct and DIArgList uses of LocalAsMetadata, which is that the former replaces the SSA value with an empty MDNode if RF_IgnoreMissingLocals is not set and there is no known mapping, while the latter replaces it with an undef value. The former approach is out-of-date, as we currently expect undef values to be used for any dead debug values, and anything else will not be handled correctly during ISel (and possible other places). I'm not sure whether this should be fixed up as part of this patch - thoughts?
I'd missed this context before!