mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Provide the correct primary file name to IRGenOpts.
Previously, we were always using the first file name as the main source file name in the debug info, which was completely wrong and led to only that file having debug info. <rdar://problem/15786017>, again. Swift SVN r13665
This commit is contained in:
@@ -691,8 +691,12 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
|
||||
// TODO: investigate whether these should be removed, in favor of definitions
|
||||
// in other classes.
|
||||
if (!FrontendOpts.InputFilenames.empty())
|
||||
Opts.MainInputFilename = FrontendOpts.InputFilenames[0];
|
||||
if (FrontendOpts.PrimaryInput && FrontendOpts.PrimaryInput->isFilename()) {
|
||||
unsigned Index = FrontendOpts.PrimaryInput->Index;
|
||||
Opts.MainInputFilename = FrontendOpts.InputFilenames[Index];
|
||||
} else if (FrontendOpts.InputFilenames.size() == 1) {
|
||||
Opts.MainInputFilename = FrontendOpts.InputFilenames.front();
|
||||
}
|
||||
Opts.OutputFilename = FrontendOpts.OutputFilename;
|
||||
Opts.ModuleName = FrontendOpts.ModuleName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user