Actually check if lseek works instead of using a filename based heuristic.

llvm-svn: 234620
This commit is contained in:
Rafael Espindola 2015-04-10 18:16:30 +00:00
parent 74d2f617f2
commit d7e306fbcc
1 changed files with 7 additions and 7 deletions

View File

@ -600,15 +600,15 @@ void DumpTokensAction::ExecuteAction() {
void GeneratePTHAction::ExecuteAction() {
CompilerInstance &CI = getCompilerInstance();
if (CI.getFrontendOpts().OutputFile.empty() ||
CI.getFrontendOpts().OutputFile == "-") {
// FIXME: Don't fail this way.
// FIXME: Verify that we can actually seek in the given file.
llvm::report_fatal_error("PTH requires a seekable file for output!");
}
llvm::raw_fd_ostream *OS =
CI.createDefaultOutputFile(true, getCurrentFile());
if (!OS) return;
if (!OS)
return;
if (!OS->supportsSeeking()) {
// FIXME: Don't fail this way.
llvm::report_fatal_error("PTH requires a seekable file for output!");
}
CacheTokens(CI.getPreprocessor(), OS);
}