From: Benjamin Kramer Date: Mon, 6 Sep 2010 23:43:28 +0000 (+0000) Subject: Replace loops with SmallVector::append. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ea884b429445aa6f1af5bc6e51d0b65a4043e24;p=clang Replace loops with SmallVector::append. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113185 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 388ae8a98f..6e79eb22bd 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -3545,8 +3545,7 @@ ASTReader::SetGloballyVisibleDecls(IdentifierInfo *II, PendingIdentifierInfos.push_back(PendingIdentifierInfo()); PendingIdentifierInfo &PII = PendingIdentifierInfos.back(); PII.II = II; - for (unsigned I = 0, N = DeclIDs.size(); I != N; ++I) - PII.DeclIDs.push_back(DeclIDs[I]); + PII.DeclIDs.append(DeclIDs.begin(), DeclIDs.end()); return; } diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 3b6b218e74..f661b45df0 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -2690,10 +2690,8 @@ void ASTWriter::AddSourceRange(SourceRange Range, RecordData &Record) { void ASTWriter::AddAPInt(const llvm::APInt &Value, RecordData &Record) { Record.push_back(Value.getBitWidth()); - unsigned N = Value.getNumWords(); - const uint64_t* Words = Value.getRawData(); - for (unsigned I = 0; I != N; ++I) - Record.push_back(Words[I]); + const uint64_t *Words = Value.getRawData(); + Record.append(Words, Words + Value.getNumWords()); } void ASTWriter::AddAPSInt(const llvm::APSInt &Value, RecordData &Record) {