There's no need to handle DISubprogram in getScopeIndex for C/C++ as a function can't be nested in another function. That's not the case for Fortran-- a routine can be nested in another routine through the 'contains' keyword. This patch skips the emission of the debug info for the containing function.
Please note that before this patch, getScopeIndex would emit a LF_STRING_ID when given a DISubprogram. That's not only incorrect, but would also cause link-time error with the linker from a more recent version (Aug. 20219) of VS2019.
My suggestion was to return TI here but skip recordTypeIndexForDINode when Scope is a subprogram, but this is fine too.