Files
archived-llvm/include/llvm/Support/NativeFormatting.h
Zachary Turner 86a0c0db41 [raw_ostream] Raise some helper functions out of raw_ostream.
Low level functionality to format numbers were embedded in the
implementation of raw_ostream.  I have need to use these through
an interface other than the overloaded stream operators, so they
need to be raised to a level that they can be used from either
raw_ostream operators or other code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 19:24:45 +00:00

31 lines
1.1 KiB
C++

//===- NativeFormatting.h - Low level formatting helpers ---------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SUPPORT_NATIVE_FORMATTING_H
#define LLVM_SUPPORT_NATIVE_FORMATTING_H
#include "llvm/Support/raw_ostream.h"
#include <cstdint>
namespace llvm {
enum class FloatStyle { Exponent, Decimal };
void write_ulong(raw_ostream &S, unsigned long N, std::size_t MinWidth);
void write_long(raw_ostream &S, long N, std::size_t MinWidth);
void write_ulonglong(raw_ostream &S, unsigned long long N,
std::size_t MinWidth);
void write_longlong(raw_ostream &S, long long N, std::size_t MinWidth);
void write_hex(raw_ostream &S, unsigned long long N, std::size_t MinWidth,
bool Upper, bool Prefix);
void write_double(raw_ostream &S, double D, std::size_t MinWidth,
std::size_t MinDecimals, FloatStyle Style);
}
#endif