diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-28 18:05:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-28 18:05:25 +0000 |
commit | b26d578b417aa94eba4ddbd2e23865f9a9ae6f4e (patch) | |
tree | fcc540f6f807629a9be7908e4d848bf46e645c08 /clang/lib/CodeGen/CGObjCRuntime.cpp | |
parent | 6b610b387d481cf20d5ea31cb01cea595d19ed2f (diff) | |
download | bcm5719-llvm-b26d578b417aa94eba4ddbd2e23865f9a9ae6f4e.tar.gz bcm5719-llvm-b26d578b417aa94eba4ddbd2e23865f9a9ae6f4e.zip |
Eliminate most uses of ShallowCollectObjCIvars which requires
a vector for collection. Use iterators where needed instead.
// rdar://6817577
llvm-svn: 134015
Diffstat (limited to 'clang/lib/CodeGen/CGObjCRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjCRuntime.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGObjCRuntime.cpp b/clang/lib/CodeGen/CGObjCRuntime.cpp index 6ce1cb94353..0734e74d57a 100644 --- a/clang/lib/CodeGen/CGObjCRuntime.cpp +++ b/clang/lib/CodeGen/CGObjCRuntime.cpp @@ -52,14 +52,14 @@ static uint64_t LookupFieldBitOffset(CodeGen::CodeGenModule &CGM, // implemented. This should be fixed to get the information from the layout // directly. unsigned Index = 0; - llvm::SmallVector<ObjCIvarDecl*, 16> Ivars; - CGM.getContext().ShallowCollectObjCIvars(Container, Ivars); - for (unsigned k = 0, e = Ivars.size(); k != e; ++k) { - if (Ivar == Ivars[k]) + ObjCInterfaceDecl *IDecl = const_cast<ObjCInterfaceDecl*>(Container); + + for (ObjCIvarDecl *IVD = IDecl->all_declared_ivar_begin(); + IVD; IVD = IVD->getNextIvar()) { + if (Ivar == IVD) break; ++Index; } - assert(Index != Ivars.size() && "Ivar is not inside container!"); assert(Index < RL->getFieldCount() && "Ivar is not inside record layout!"); return RL->getFieldOffset(Index); |