Debug Info: Assert that the main source file name is non-empty.

The Darwin linker won't process the debug info if the source file name
is invalid so there is no point in having a fallback implemented there.

<rdar://problem/25130236>
This commit is contained in:
Adrian Prantl
2016-09-23 10:30:59 -07:00
parent 0375994df4
commit 3fd5afc6d0
3 changed files with 17 additions and 16 deletions

View File

@@ -384,8 +384,11 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
else
RegisterPreservingCC = DefaultCC;
if (IRGen.Opts.DebugInfoKind > IRGenDebugInfoKind::None)
DebugInfo = new IRGenDebugInfo(IRGen.Opts, *CI, *this, Module, SF);
if (IRGen.Opts.DebugInfoKind > IRGenDebugInfoKind::None) {
StringRef MainFile(SF ? SF->getFilename()
: StringRef(IRGen.Opts.MainInputFilename));
DebugInfo = new IRGenDebugInfo(IRGen.Opts, *CI, *this, Module, MainFile);
}
initClangTypeConverter();
}