[cfe-commits] r113185 - in /cfe/trunk/lib/Serialization: ASTReader.cpp ASTWriter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Sep 6 16:43:28 PDT 2010
Author: d0k
Date: Mon Sep 6 18:43:28 2010
New Revision: 113185
URL: http://llvm.org/viewvc/llvm-project?rev=113185&view=rev
Log:
Replace loops with SmallVector::append.
Modified:
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=113185&r1=113184&r2=113185&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Sep 6 18:43:28 2010
@@ -3545,8 +3545,7 @@
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;
}
Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=113185&r1=113184&r2=113185&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Mon Sep 6 18:43:28 2010
@@ -2690,10 +2690,8 @@
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) {
More information about the cfe-commits
mailing list