[cfe-commits] r43880 - in /cfe/trunk: Driver/RewriteTest.cpp Rewrite/Rewriter.cpp
Chris Lattner
sabre at nondot.org
Wed Nov 7 20:27:26 PST 2007
Author: lattner
Date: Wed Nov 7 22:27:23 2007
New Revision: 43880
URL: http://llvm.org/viewvc/llvm-project?rev=43880&view=rev
Log:
use std::copy instead of memcpy for abstraction.
Disable rewrite-tabs. This speeds up processing of the commentified huge
crazy testcase steve gave me from 20s to 6.6s in a release build.
Modified:
cfe/trunk/Driver/RewriteTest.cpp
cfe/trunk/Rewrite/Rewriter.cpp
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=43880&r1=43879&r2=43880&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Wed Nov 7 22:27:23 2007
@@ -195,7 +195,9 @@
RewriteTest::~RewriteTest() {
// Get the top-level buffer that this corresponds to.
- RewriteTabs();
+
+ // Rewrite tabs if we care.
+ //RewriteTabs();
// Rewrite Objective-c meta data*
std::string ResultStr;
Modified: cfe/trunk/Rewrite/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Rewrite/Rewriter.cpp?rev=43880&r1=43879&r2=43880&view=diff
==============================================================================
--- cfe/trunk/Rewrite/Rewriter.cpp (original)
+++ cfe/trunk/Rewrite/Rewriter.cpp Wed Nov 7 22:27:23 2007
@@ -121,7 +121,8 @@
assert(RealOffset+OrigLength <= Buffer.size() && "Invalid location");
// Overwrite the common piece.
- memcpy(&Buffer[RealOffset], NewStr, std::min(OrigLength, NewLength));
+ std::copy(NewStr, NewStr+std::min(OrigLength, NewLength),
+ Buffer.begin()+RealOffset);
// If replacing without shifting around, just overwrite the text.
if (OrigLength == NewLength)
More information about the cfe-commits
mailing list