From d7e306fbcc712163702c58c65409e65c99a3cc21 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 10 Apr 2015 18:16:30 +0000 Subject: Actually check if lseek works instead of using a filename based heuristic. llvm-svn: 234620 --- clang/lib/Frontend/FrontendActions.cpp | 12 ++++++------ 1 file changed, 6 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 622ca8241c2..082bf92f097 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -600,15 +600,15 @@ void DumpTokensAction::ExecuteAction() { void GeneratePTHAction::ExecuteAction() { CompilerInstance &CI = getCompilerInstance(); - if (CI.getFrontendOpts().OutputFile.empty() || - CI.getFrontendOpts().OutputFile == "-") { + llvm::raw_fd_ostream *OS = + CI.createDefaultOutputFile(true, getCurrentFile()); + if (!OS) + return; + + if (!OS->supportsSeeking()) { // 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; CacheTokens(CI.getPreprocessor(), OS); } -- cgit v1.2.3