diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-16 03:46:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-16 03:46:57 +0000 |
commit | b9bc3eca218e2670f05b34c0b3c33a46d710bd88 (patch) | |
tree | b4fb19a98f3e216976baa0e85803043c0d4b01f1 /Driver/HTMLPrint.cpp | |
parent | 2f868c013935791c421def45b422a6f6e79d2e4a (diff) |
speed up -emit-html in a release build by 6.5% by avoiding std::string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/HTMLPrint.cpp')
-rw-r--r-- | Driver/HTMLPrint.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Driver/HTMLPrint.cpp b/Driver/HTMLPrint.cpp index 981be851cf..165689d143 100644 --- a/Driver/HTMLPrint.cpp +++ b/Driver/HTMLPrint.cpp @@ -56,8 +56,10 @@ HTMLPrinter::~HTMLPrinter() { // Emit the HTML. if (const RewriteBuffer *RewriteBuf = R.getRewriteBufferFor(FileID)) { - std::string S(RewriteBuf->begin(), RewriteBuf->end()); - printf("%s\n", S.c_str()); + char *Buffer = (char*)malloc(RewriteBuf->size()); + std::copy(RewriteBuf->begin(), RewriteBuf->end(), Buffer); + fwrite(Buffer, 1, RewriteBuf->size(), stdout); + free(Buffer); } } |