aboutsummaryrefslogtreecommitdiff
path: root/lib/TableGen/TGPreprocessor.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-10-04 21:08:56 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-10-04 21:08:56 +0000
commit11ad7e5d589f4bf92a9e5384ad2ef7550070d258 (patch)
tree00f2166990665ce9ca01e13750b31672b48124f4 /lib/TableGen/TGPreprocessor.cpp
parent20f8eb2fc1d1d45d2645a45fe383f572c98d939d (diff)
Replace snprintf with raw_string_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen/TGPreprocessor.cpp')
-rw-r--r--lib/TableGen/TGPreprocessor.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/TableGen/TGPreprocessor.cpp b/lib/TableGen/TGPreprocessor.cpp
index 6c82ee3830..0fa5562d7d 100644
--- a/lib/TableGen/TGPreprocessor.cpp
+++ b/lib/TableGen/TGPreprocessor.cpp
@@ -24,10 +24,6 @@
#include <cstdlib>
#include <cstring>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
namespace llvm {
typedef std::map<std::string, std::string> 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();
}
}