This is an updated version of the D54576, which was reverted.
Problem was that SplitDebugName calls the InputInfo::getFilename
which asserts if InputInfo given is not of type Filename:
const char *getFilename() const { assert(isFilename() && "Invalid accessor."); return Data.Filename; }
At the same time at that point, it can be of type Nothing and
we need to use getBaseInput() it seems, like original code did.