summaryrefslogtreecommitdiffstats
path: root/clang/include
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/Basic/LLVM.h2
-rw-r--r--clang/include/clang/CodeGen/BackendUtil.h2
-rw-r--r--clang/include/clang/Frontend/CompilerInstance.h25
-rw-r--r--clang/include/clang/Frontend/Utils.h5
4 files changed, 19 insertions, 15 deletions
diff --git a/clang/include/clang/Basic/LLVM.h b/clang/include/clang/Basic/LLVM.h
index 3e01d25add2..0e6ff9259a1 100644
--- a/clang/include/clang/Basic/LLVM.h
+++ b/clang/include/clang/Basic/LLVM.h
@@ -45,6 +45,7 @@ namespace llvm {
class RefCountedBaseVPTR;
class raw_ostream;
+ class raw_pwrite_stream;
// TODO: DenseMap, ...
}
@@ -76,6 +77,7 @@ namespace clang {
using llvm::RefCountedBaseVPTR;
using llvm::raw_ostream;
+ using llvm::raw_pwrite_stream;
} // end namespace clang.
#endif
diff --git a/clang/include/clang/CodeGen/BackendUtil.h b/clang/include/clang/CodeGen/BackendUtil.h
index 07c61836832..8586e778894 100644
--- a/clang/include/clang/CodeGen/BackendUtil.h
+++ b/clang/include/clang/CodeGen/BackendUtil.h
@@ -34,7 +34,7 @@ namespace clang {
void EmitBackendOutput(DiagnosticsEngine &Diags, const CodeGenOptions &CGOpts,
const TargetOptions &TOpts, const LangOptions &LOpts,
StringRef TDesc, llvm::Module *M, BackendAction Action,
- raw_ostream *OS);
+ raw_pwrite_stream *OS);
}
#endif
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h
index 433c41c2243..62515666d5a 100644
--- a/clang/include/clang/Frontend/CompilerInstance.h
+++ b/clang/include/clang/Frontend/CompilerInstance.h
@@ -161,6 +161,11 @@ class CompilerInstance : public ModuleLoader {
TempFilename(std::move(O.TempFilename)), OS(std::move(O.OS)) {}
};
+ /// If the output doesn't support seeking (terminal, pipe). we switch
+ /// the stream to a buffer_ostream. These are the buffer and the original
+ /// stream.
+ std::unique_ptr<llvm::raw_fd_ostream> NonSeekStream;
+
/// The list of active output files.
std::list<OutputFile> OutputFiles;
@@ -631,21 +636,19 @@ public:
/// atomically replace the target output on success).
///
/// \return - Null on error.
- llvm::raw_fd_ostream *
- createDefaultOutputFile(bool Binary = true, StringRef BaseInput = "",
- StringRef Extension = "");
+ raw_pwrite_stream *createDefaultOutputFile(bool Binary = true,
+ StringRef BaseInput = "",
+ StringRef Extension = "");
/// Create a new output file and add it to the list of tracked output files,
/// optionally deriving the output path name.
///
/// \return - Null on error.
- llvm::raw_fd_ostream *
- createOutputFile(StringRef OutputPath,
- bool Binary, bool RemoveFileOnSignal,
- StringRef BaseInput,
- StringRef Extension,
- bool UseTemporary,
- bool CreateMissingDirectories = false);
+ raw_pwrite_stream *createOutputFile(StringRef OutputPath, bool Binary,
+ bool RemoveFileOnSignal,
+ StringRef BaseInput, StringRef Extension,
+ bool UseTemporary,
+ bool CreateMissingDirectories = false);
/// Create a new output file, optionally deriving the output path name.
///
@@ -672,7 +675,7 @@ public:
/// stored here on success.
/// \param TempPathName [out] - If given, the temporary file path name
/// will be stored here on success.
- static std::unique_ptr<llvm::raw_fd_ostream>
+ std::unique_ptr<raw_pwrite_stream>
createOutputFile(StringRef OutputPath, std::error_code &Error, bool Binary,
bool RemoveFileOnSignal, StringRef BaseInput,
StringRef Extension, bool UseTemporary,
diff --git a/clang/include/clang/Frontend/Utils.h b/clang/include/clang/Frontend/Utils.h
index 4cd93b994fe..cd0ebf61120 100644
--- a/clang/include/clang/Frontend/Utils.h
+++ b/clang/include/clang/Frontend/Utils.h
@@ -159,9 +159,8 @@ void AttachHeaderIncludeGen(Preprocessor &PP, bool ShowAllHeaders = false,
StringRef OutputPath = "",
bool ShowDepth = true, bool MSStyle = false);
-/// CacheTokens - Cache tokens for use with PCH. Note that this requires
-/// a seekable stream.
-void CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS);
+/// Cache tokens for use with PCH. Note that this requires a seekable stream.
+void CacheTokens(Preprocessor &PP, raw_pwrite_stream *OS);
/// The ChainedIncludesSource class converts headers to chained PCHs in
/// memory, mainly for testing.
OpenPOWER on IntegriCloud