aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-02-15 22:15:41 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-02-15 22:15:41 +0000
commitaf09f22c4b70efc342ff2ecc6d5f9148837df42b (patch)
tree176287d129d0b7365111174afa2cf44c885b97a1 /llvm/lib/Support/raw_ostream.cpp
parent673476684ee1eb0c58cf51a69ea2eb823132f631 (diff)
downloadllvm-af09f22c4b70efc342ff2ecc6d5f9148837df42b.zip
llvm-af09f22c4b70efc342ff2ecc6d5f9148837df42b.tar.gz
llvm-af09f22c4b70efc342ff2ecc6d5f9148837df42b.tar.bz2
Format: Modernize using variadic templates.
Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can add more of it when it's actually needed. Also removes an ancient macro hack that leaks a macro into the global namespace. Clean up users that made use of the convenient hack. llvm-svn: 229337
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index aa618b9..051e2dd 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -242,7 +242,7 @@ raw_ostream &raw_ostream::operator<<(double N) {
char buf[16];
unsigned len;
- len = snprintf(buf, sizeof(buf), "%e", N);
+ len = format("%e", N).snprint(buf, sizeof(buf));
if (len <= sizeof(buf) - 2) {
if (len >= 5 && buf[len - 5] == 'e' && buf[len - 3] == '0') {
int cs = buf[len - 4];