LLVM  9.0.0svn
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_NATIVE_FORMATTING_H
10 #define LLVM_SUPPORT_NATIVE_FORMATTING_H
11 
12 #include "llvm/ADT/Optional.h"
14 
15 #include <cstdint>
16 
17 namespace llvm {
19 enum class IntegerStyle {
20  Integer,
21  Number,
22 };
24 
26 
28 
29 void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
30  IntegerStyle Style);
31 void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
32 void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
33  IntegerStyle Style);
34 void write_integer(raw_ostream &S, long N, size_t MinDigits,
35  IntegerStyle Style);
36 void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
37  IntegerStyle Style);
38 void write_integer(raw_ostream &S, long long N, size_t MinDigits,
39  IntegerStyle Style);
40 
41 void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
42  Optional<size_t> Width = None);
43 void write_double(raw_ostream &S, double D, FloatStyle Style,
44  Optional<size_t> Precision = None);
45 }
46 
47 #endif
48 
This class represents lattice values for constants.
Definition: AllocatorList.h:23
void write_double(raw_ostream &S, double D, FloatStyle Style, Optional< size_t > Precision=None)
size_t getDefaultPrecision(FloatStyle Style)
bool isPrefixedHexStyle(HexPrintStyle S)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style, Optional< size_t > Width=None)
#define N
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits, IntegerStyle Style)