[DebugInfo] Delete dead code, simplify and fix code style for some existing code. No functionality change.