//===-- llvm/Support/FormattedStream.h - Formatted streams ------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file contains raw_ostream implementations for streams to do // things like pretty-print comments. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_FORMATTEDSTREAM_H #define LLVM_SUPPORT_FORMATTEDSTREAM_H #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" #include <utility> namespace llvm { /// formatted_raw_ostream - A raw_ostream that wraps another one and keeps track /// of line and column position, allowing padding out to specific column /// boundaries and querying the number of lines written to the stream. This /// assumes that the contents of the stream is valid UTF-8 encoded text. This /// doesn't attempt to handle everything Unicode can do (combining characters, /// right-to-left markers, etc), but should cover the cases likely to appear in /// source code or diagnostic messages. class formatted_raw_ostream : public raw_ostream { … }; /// fouts() - This returns a reference to a formatted_raw_ostream for /// standard output. Use it like: fouts() << "foo" << "bar"; formatted_raw_ostream &fouts(); /// ferrs() - This returns a reference to a formatted_raw_ostream for /// standard error. Use it like: ferrs() << "foo" << "bar"; formatted_raw_ostream &ferrs(); /// fdbgs() - This returns a reference to a formatted_raw_ostream for /// debug output. Use it like: fdbgs() << "foo" << "bar"; formatted_raw_ostream &fdbgs(); } // end llvm namespace #endif