[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / Support / raw_os_ostream.h
blobc51a94da3a28d2c7c159311e09a52d097fa66225
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.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
14 #define LLVM_SUPPORT_RAW_OS_OSTREAM_H
16 #include "llvm/Support/raw_ostream.h"
17 #include <iosfwd>
19 namespace llvm {
21 /// raw_os_ostream - A raw_ostream that writes to an std::ostream. This is a
22 /// simple adaptor class. It does not check for output errors; clients should
23 /// use the underlying stream to detect errors.
24 class raw_os_ostream : public raw_ostream {
25 std::ostream &OS;
27 /// write_impl - See raw_ostream::write_impl.
28 void write_impl(const char *Ptr, size_t Size) override;
30 /// current_pos - Return the current position within the stream, not
31 /// counting the bytes currently in the buffer.
32 uint64_t current_pos() const override;
34 public:
35 raw_os_ostream(std::ostream &O) : OS(O) {}
36 ~raw_os_ostream() override;
39 } // end llvm namespace
41 #endif