LLVM 22.0.0git
raw_os_ostream.h
Go to the documentation of this file.
1//===- raw_os_ostream.h - std::ostream adaptor for raw_ostream --*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the raw_os_ostream class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
14#define LLVM_SUPPORT_RAW_OS_OSTREAM_H
15
18#include <iosfwd>
19
20namespace llvm {
21
22/// raw_os_ostream - A raw_ostream that writes to an std::ostream. This is a
23/// simple adaptor class. It does not check for output errors; clients should
24/// use the underlying stream to detect errors.
26 std::ostream &OS;
27
28 /// write_impl - See raw_ostream::write_impl.
29 void write_impl(const char *Ptr, size_t Size) override;
30
31 /// current_pos - Return the current position within the stream, not
32 /// counting the bytes currently in the buffer.
33 uint64_t current_pos() const override;
34
35public:
36 raw_os_ostream(std::ostream &O) : OS(O) {}
37 ~raw_os_ostream() override;
38};
39
40} // end llvm namespace
41
42#endif
#define LLVM_ABI
Definition Compiler.h:213
raw_os_ostream - A raw_ostream that writes to an std::ostream.
raw_os_ostream(std::ostream &O)
raw_ostream(bool unbuffered=false, OStreamKind K=OStreamKind::OK_OStream)
This is an optimization pass for GlobalISel generic memory operations.