// If both tail splits were valid integers, return success.
if (!ColSplit.second.getAsInteger(10, PSL.Column) &&
- !LineSplit.second.getAsInteger(10, PSL.Line))
+ !LineSplit.second.getAsInteger(10, PSL.Line)) {
PSL.FileName = LineSplit.first;
+ // On the command-line, stdin may be specified via "-". Inside the
+ // compiler, stdin is called "<stdin>".
+ if (PSL.FileName == "-")
+ PSL.FileName = "<stdin>";
+ }
+
return PSL;
}
};
Diags.Report(diag::err_fe_error_reading_stdin);
return false;
}
- SourceMgr.createMainFileIDForMemBuffer(SB);
+ const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
+ SB->getBufferSize(), 0);
+ SourceMgr.createMainFileID(File);
+ SourceMgr.overrideFileContents(File, SB);
}
assert(!SourceMgr.getMainFileID().isInvalid() &&