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.