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.

llvm-svn: 43880
This commit is contained in:
Chris Lattner 2007-11-08 04:27:23 +00:00
parent 4573cc708a
commit 9fd5890e52
2 changed files with 5 additions and 2 deletions

View 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;

View 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)