1//===- FormatCommon.h - Formatters for common LLVM types --------*- C++ -*-===//
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
7//===----------------------------------------------------------------------===//
9#ifndef LLVM_SUPPORT_FORMATCOMMON_H
10#define LLVM_SUPPORT_FORMATCOMMON_H
19/// Helper class to format to a \p Width wide field, with alignment \p Where
32 // If we don't need to align, we can format straight into the underlying
33 // stream. Otherwise we have to go through an intermediate stream first
34 // in order to calculate how long the output is so we can align it.
35 // TODO: Make the format method return the number of bytes written, that
36 // way we can also skip the intermediate stream for left-aligned output.
50 unsigned PadAmount =
Width -
static_cast<unsigned>(Item.
size());
57 unsigned X = PadAmount / 2;
60 fill(S, PadAmount -
X);
This file defines the SmallString class.
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
This is an optimization pass for GlobalISel generic memory operations.
void fill(R &&Range, T &&Value)
Provide wrappers to std::fill which take ranges instead of having to pass begin/end explicitly.
FunctionAddr VTableAddr Count
void format(raw_ostream &S, StringRef Options)
FmtAlign(support::detail::format_adapter &Adapter, AlignStyle Where, unsigned Width, char Fill=' ')
support::detail::format_adapter & Adapter