From 11ad7e5d589f4bf92a9e5384ad2ef7550070d258 Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Tue, 4 Oct 2011 21:08:56 +0000 Subject: [PATCH] Replace snprintf with raw_string_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141116 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/TGPreprocessor.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/TableGen/TGPreprocessor.cpp b/lib/TableGen/TGPreprocessor.cpp index 6c82ee38302..0fa5562d7dc 100644 --- a/lib/TableGen/TGPreprocessor.cpp +++ b/lib/TableGen/TGPreprocessor.cpp @@ -24,10 +24,6 @@ #include #include -#ifdef _MSC_VER -#define snprintf _snprintf -#endif - namespace llvm { typedef std::map TGPPEnvironment; @@ -170,9 +166,10 @@ public: if (Kind == tgpprange_list) return Vals.at(i); else { - char buf[32]; - snprintf(buf, sizeof(buf), "%ld", From + (long int)i); - return std::string(buf); + std::string Result; + raw_string_ostream Tmp(Result); + Tmp << (From + (long int)i); + return Tmp.str(); } }