]> granicus.if.org Git - clang/commitdiff
use std::copy instead of memcpy for abstraction.
authorChris Lattner <sabre@nondot.org>
Thu, 8 Nov 2007 04:27:23 +0000 (04:27 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 8 Nov 2007 04:27:23 +0000 (04:27 +0000)
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

Driver/RewriteTest.cpp
Rewrite/Rewriter.cpp

index 8ff6bc6438816012954a4164b8be4cff3674a2ea..a7f1c209b3103b1d55ba0f91de70255382698e31 100644 (file)
@@ -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;
index f068f68ae9febd49f49373e100c56adde4b6d424..5e6374e9b981e4bc98821484048a11717bd397dd 100644 (file)
@@ -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)