diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-10-04 21:08:56 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-10-04 21:08:56 +0000 |
commit | aec9739e16bc61e2a997d08745ab86a1362662ce (patch) | |
tree | 848e7d65834ac8e745ba46689b1b578c885e2130 /llvm/lib/TableGen/TGPreprocessor.cpp | |
parent | f3e1fc3f869807cf699b41feee3066c3363eebe3 (diff) | |
download | bcm5719-llvm-aec9739e16bc61e2a997d08745ab86a1362662ce.tar.gz bcm5719-llvm-aec9739e16bc61e2a997d08745ab86a1362662ce.zip |
Replace snprintf with raw_string_ostream.
llvm-svn: 141116
Diffstat (limited to 'llvm/lib/TableGen/TGPreprocessor.cpp')
-rw-r--r-- | llvm/lib/TableGen/TGPreprocessor.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/TableGen/TGPreprocessor.cpp b/llvm/lib/TableGen/TGPreprocessor.cpp index 6c82ee38302..0fa5562d7dc 100644 --- a/llvm/lib/TableGen/TGPreprocessor.cpp +++ b/llvm/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(); } } |