When DISubprogram is being cloned, types belonging to its scope
must be cloned too. Otherwise, function-local types of the original
function are used in the cloned one, which may cause conflicts.
It helps to tackle the crash encountered after committing
https://reviews.llvm.org/D144006.
I guess this comes up, though I'd love it if it doesn't...
When does this situation arise? I would've hoped that function-local types wouldn't appear in the CU's retained types list. It'd simplify the model if they were only retained by either the CU or the subprogram, and not both.