diff --git a/llvm/include/llvm/Tools/StringExtras.h b/llvm/include/llvm/Tools/StringExtras.h index 31dedb42488d95536acf2048422699b5c37f3531..819da2f054690d761319691b1b576ad2cb876a00 100644 --- a/llvm/include/llvm/Tools/StringExtras.h +++ b/llvm/include/llvm/Tools/StringExtras.h @@ -9,6 +9,7 @@ #define LLVM_TOOLS_STRING_EXTRAS_H #include +#include #include "llvm/Tools/DataTypes.h" static inline string utostr(uint64_t X, bool isNeg = false) { @@ -60,4 +61,10 @@ static inline string itostr(int X) { return utostr((unsigned)X); } +static inline string ftostr(double V) { + char Buffer[200]; + snprintf(Buffer, 200, "%f", V); + return Buffer; +} + #endif