annotate include/llvm/Support/NativeFormatting.h @ 125:56c5119fbcd2

fix
author mir3636
date Sun, 03 Dec 2017 20:09:16 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
1 //===- NativeFormatting.h - Low level formatting helpers ---------*- C++-*-===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
2 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
4 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
7 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
9
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
10 #ifndef LLVM_SUPPORT_NATIVE_FORMATTING_H
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
11 #define LLVM_SUPPORT_NATIVE_FORMATTING_H
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
12
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
13 #include "llvm/ADT/Optional.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
14 #include "llvm/Support/raw_ostream.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
15
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
16 #include <cstdint>
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
17
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
18 namespace llvm {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
19 enum class FloatStyle { Exponent, ExponentUpper, Fixed, Percent };
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
20 enum class IntegerStyle {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
21 Integer,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
22 Number,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
23 };
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
24 enum class HexPrintStyle { Upper, Lower, PrefixUpper, PrefixLower };
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
25
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
26 size_t getDefaultPrecision(FloatStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
27
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
28 bool isPrefixedHexStyle(HexPrintStyle S);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
29
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
30 void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
31 IntegerStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
32 void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
33 void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
34 IntegerStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
35 void write_integer(raw_ostream &S, long N, size_t MinDigits,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
36 IntegerStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
37 void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
38 IntegerStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
39 void write_integer(raw_ostream &S, long long N, size_t MinDigits,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
40 IntegerStyle Style);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
41
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
42 void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
43 Optional<size_t> Width = None);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
44 void write_double(raw_ostream &S, double D, FloatStyle Style,
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
45 Optional<size_t> Precision = None);
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
46 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
47
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
48 #endif
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
49