From 463d4dd6c6cf85180e44a2a6a27b7d8ea6e5cfa4 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 13 Apr 2015 11:14:39 +0000 Subject: Bring r234620 back now that llvm is fixed. LLVM can now detect if a fd is seekable on windows. Original commit message: Actually check if lseek works instead of using a filename based heuristic. llvm-svn: 234738 --- clang/lib/Frontend/FrontendActions.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'clang/lib/Frontend/FrontendActions.cpp') diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 5f91ed0a974..5ffe65f9f2a 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -599,16 +599,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->supportsSeeking()) { + // FIXME: Don't fail this way. + llvm::report_fatal_error("PTH requires a seekable file for output!"); + } + CacheTokens(CI.getPreprocessor(), OS); } -- cgit v1.2.3