LLVM  14.0.0git
NativeFormatting.h
Go to the documentation of this file.
1 //===- NativeFormatting.h - Low level formatting helpers ---------*- 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 #ifndef LLVM_SUPPORT_NATIVEFORMATTING_H
10 #define LLVM_SUPPORT_NATIVEFORMATTING_H
11 
12 #include "llvm/ADT/Optional.h"
13 #include <cstdint>
14 
15 namespace llvm {
16 class raw_ostream;
18 enum class IntegerStyle {
19  Integer,
20  Number,
21 };
23 
25 
27 
28 void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
30 void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
31 void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
33 void write_integer(raw_ostream &S, long N, size_t MinDigits,
35 void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
37 void write_integer(raw_ostream &S, long long N, size_t MinDigits,
39 
40 void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
41  Optional<size_t> Width = None);
42 void write_double(raw_ostream &S, double D, FloatStyle Style,
43  Optional<size_t> Precision = None);
44 }
45 
46 #endif
47 
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
Optional.h
llvm::HexPrintStyle::Upper
@ Upper
llvm::FloatStyle::Percent
@ Percent
llvm::IntegerStyle
IntegerStyle
Definition: NativeFormatting.h:18
llvm::FloatStyle::ExponentUpper
@ ExponentUpper
llvm::FloatStyle
FloatStyle
Definition: NativeFormatting.h:17
llvm::None
const NoneType None
Definition: None.h:23
llvm::IntegerStyle::Number
@ Number
uint64_t
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::HexPrintStyle::PrefixLower
@ PrefixLower
llvm::HexStyle::Style
Style
Definition: MCInstPrinter.h:32
llvm::IntegerStyle::Integer
@ Integer
llvm::FloatStyle::Exponent
@ Exponent
llvm::getDefaultPrecision
size_t getDefaultPrecision(FloatStyle Style)
Definition: NativeFormatting.cpp:253
llvm::write_hex
void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style, Optional< size_t > Width=None)
Definition: NativeFormatting.cpp:133
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::isPrefixedHexStyle
bool isPrefixedHexStyle(HexPrintStyle S)
Definition: NativeFormatting.cpp:249
llvm::HexPrintStyle::PrefixUpper
@ PrefixUpper
llvm::HexPrintStyle
HexPrintStyle
Definition: NativeFormatting.h:22
llvm::HexPrintStyle::Lower
@ Lower
llvm::write_double
void write_double(raw_ostream &S, double D, FloatStyle Style, Optional< size_t > Precision=None)
Definition: NativeFormatting.cpp:163
llvm::write_integer
void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits, IntegerStyle Style)
Definition: NativeFormatting.cpp:103
llvm::AMDGPU::Hwreg::Width
Width
Definition: SIDefines.h:413
N
#define N
llvm::FloatStyle::Fixed
@ Fixed