#define LLVM_ADT_STRINGEXTRAS_H
#include "llvm/Support/DataTypes.h"
+#include "llvm/ADT/APFloat.h"
#include <cctype>
#include <cstdio>
#include <string>
return B;
}
+static inline std::string ftostr(APFloat V) {
+ if (&V.getSemantics() == &APFloat::IEEEsingle)
+ return ftostr(V.convertToDouble());
+ else if (&V.getSemantics() == &APFloat::IEEEdouble)
+ return ftostr((double)V.convertToFloat());
+ return 0; // error
+}
+
static inline std::string LowercaseString(const std::string &S) {
std::string result(S);
for (unsigned i = 0; i < S.length(); ++i)