aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReaderDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-22 22:45:36 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-22 22:45:36 +0000
commit75fdb2377604e53678102076991bea345ace4692 (patch)
treee6bfa678e090d50a153be63036ed779b9dc516a6 /lib/Frontend/PCHReaderDecl.cpp
parent66ef111b167833c197cded0a1befab4a483d7d6d (diff)
Fix lots of PCH crashes caused by the new assertions in
llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now runs cleanly (again). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 53dd6df61b..7d4c634193 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -247,7 +247,7 @@ void PCHDeclReader::VisitObjCClassDecl(ObjCClassDecl *CD) {
ClassRefs.reserve(NumClassRefs);
for (unsigned I = 0; I != NumClassRefs; ++I)
ClassRefs.push_back(cast<ObjCInterfaceDecl>(Reader.GetDecl(Record[Idx++])));
- CD->setClassList(*Reader.getContext(), &ClassRefs[0], NumClassRefs);
+ CD->setClassList(*Reader.getContext(), ClassRefs.data(), NumClassRefs);
}
void PCHDeclReader::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *FPD) {
@@ -257,7 +257,7 @@ void PCHDeclReader::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *FPD) {
ProtoRefs.reserve(NumProtoRefs);
for (unsigned I = 0; I != NumProtoRefs; ++I)
ProtoRefs.push_back(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++])));
- FPD->setProtocolList(&ProtoRefs[0], NumProtoRefs, *Reader.getContext());
+ FPD->setProtocolList(ProtoRefs.data(), NumProtoRefs, *Reader.getContext());
}
void PCHDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) {
@@ -373,7 +373,7 @@ void PCHDeclReader::VisitBlockDecl(BlockDecl *BD) {
Params.reserve(NumParams);
for (unsigned I = 0; I != NumParams; ++I)
Params.push_back(cast<ParmVarDecl>(Reader.GetDecl(Record[Idx++])));
- BD->setParams(*Reader.getContext(), &Params[0], NumParams);
+ BD->setParams(*Reader.getContext(), Params.data(), NumParams);
}
std::pair<uint64_t, uint64_t>
@@ -483,7 +483,7 @@ Attr *PCHReader::ReadAttributes() {
llvm::SmallVector<unsigned, 16> ArgNums;
ArgNums.insert(ArgNums.end(), &Record[Idx], &Record[Idx] + Size);
Idx += Size;
- New = ::new (*Context) NonNullAttr(&ArgNums[0], Size);
+ New = ::new (*Context) NonNullAttr(ArgNums.data(), Size);
break;
}