diff options
author | Jordy Rose <jediknil@belkadan.com> | 2011-07-22 02:08:32 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2011-07-22 02:08:32 +0000 |
commit | a91768e56977920cbe9723c8f3f5371e3d37d379 (patch) | |
tree | 2ac709e8609e081306827eed45149fa419de0eeb /clang/lib/CodeGen/CGObjCRuntime.cpp | |
parent | dff8de77a611f93712df6bcfb54c2e0bed599f02 (diff) | |
download | bcm5719-llvm-a91768e56977920cbe9723c8f3f5371e3d37d379.tar.gz bcm5719-llvm-a91768e56977920cbe9723c8f3f5371e3d37d379.zip |
Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
This was previously not-const only because it has to lazily construct a chain
of ivars the first time it is called (and after the chain is invalidated).
In practice, all the clients were just const_casting their const Decls;
all those now-unnecessary const_casts have been removed.
llvm-svn: 135741
Diffstat (limited to 'clang/lib/CodeGen/CGObjCRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjCRuntime.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCRuntime.cpp b/clang/lib/CodeGen/CGObjCRuntime.cpp index 52338606b83..bc739c84110 100644 --- a/clang/lib/CodeGen/CGObjCRuntime.cpp +++ b/clang/lib/CodeGen/CGObjCRuntime.cpp @@ -52,9 +52,8 @@ static uint64_t LookupFieldBitOffset(CodeGen::CodeGenModule &CGM, // implemented. This should be fixed to get the information from the layout // directly. unsigned Index = 0; - ObjCInterfaceDecl *IDecl = const_cast<ObjCInterfaceDecl*>(Container); - for (ObjCIvarDecl *IVD = IDecl->all_declared_ivar_begin(); + for (const ObjCIvarDecl *IVD = Container->all_declared_ivar_begin(); IVD; IVD = IVD->getNextIvar()) { if (Ivar == IVD) break; |