diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-08 04:27:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-08 04:27:23 +0000 |
commit | 74a0c77ce6cf5fbcaccbaeda35dfb2ff7c02c83e (patch) | |
tree | 2eaea3710a0dc57e7bcc9ac229d23fb8db5167c5 | |
parent | 116c08938409b23704b60dd1a78a9243e3621407 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43880 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/RewriteTest.cpp | 4 | ||||
-rw-r--r-- | Rewrite/Rewriter.cpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index 8ff6bc6438..a7f1c209b3 100644 --- a/Driver/RewriteTest.cpp +++ b/Driver/RewriteTest.cpp @@ -195,7 +195,9 @@ void RewriteTest::HandleDeclInMainFile(Decl *D) { 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; diff --git a/Rewrite/Rewriter.cpp b/Rewrite/Rewriter.cpp index f068f68ae9..5e6374e9b9 100644 --- a/Rewrite/Rewriter.cpp +++ b/Rewrite/Rewriter.cpp @@ -121,7 +121,8 @@ void RewriteBuffer::ReplaceText(unsigned OrigOffset, unsigned OrigLength, 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) |