aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2009-08-16 23:36:19 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2009-08-16 23:36:19 +0000
commita15d890c34b5e3a6373c410ebc58453f2d52f43b (patch)
tree20e689f83e8fa199483f1cbbd3eece1d176cc87f /include
parent1b9104ff80ec708dee522128b1f6a929fdd323dd (diff)
downloadexternal_llvm-a15d890c34b5e3a6373c410ebc58453f2d52f43b.zip
external_llvm-a15d890c34b5e3a6373c410ebc58453f2d52f43b.tar.gz
external_llvm-a15d890c34b5e3a6373c410ebc58453f2d52f43b.tar.bz2
Modify APFloat to take a StringRef instead of a c string.
This also adds unit tests to APFloat that mainly tests the string handling of APFloat, but not much else of it's api. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/APFloat.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/ADT/APFloat.h b/include/llvm/ADT/APFloat.h
index 928ecc0..349426b 100644
--- a/include/llvm/ADT/APFloat.h
+++ b/include/llvm/ADT/APFloat.h
@@ -109,6 +109,7 @@ namespace llvm {
typedef signed short exponent_t;
struct fltSemantics;
+ struct StringRef;
/* When bits of a floating point number are truncated, this enum is
used to indicate what fraction of the LSB those bits represented.
@@ -172,7 +173,7 @@ namespace llvm {
};
// Constructors.
- APFloat(const fltSemantics &, const char *);
+ APFloat(const fltSemantics &, const StringRef &);
APFloat(const fltSemantics &, integerPart);
APFloat(const fltSemantics &, fltCategory, bool negative, unsigned type=0);
explicit APFloat(double d);
@@ -234,7 +235,7 @@ namespace llvm {
bool, roundingMode);
opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
bool, roundingMode);
- opStatus convertFromString(const char *, roundingMode);
+ opStatus convertFromString(const StringRef&, roundingMode);
APInt bitcastToAPInt() const;
double convertToDouble() const;
float convertToFloat() const;
@@ -312,8 +313,8 @@ namespace llvm {
roundingMode, bool *) const;
opStatus convertFromUnsignedParts(const integerPart *, unsigned int,
roundingMode);
- opStatus convertFromHexadecimalString(const char *, roundingMode);
- opStatus convertFromDecimalString (const char *, roundingMode);
+ opStatus convertFromHexadecimalString(const StringRef&, roundingMode);
+ opStatus convertFromDecimalString (const StringRef&, roundingMode);
char *convertNormalToHexString(char *, unsigned int, bool,
roundingMode) const;
opStatus roundSignificandWithExponent(const integerPart *, unsigned int,