From db8264e4c5ffd7af6fbad4ca4306bd382bb02691 Mon Sep 17 00:00:00 2001 From: Jordy Rose Date: Fri, 22 Jul 2011 02:08:32 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135741 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 0ac3b663cb..fd7128ed03 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2001,9 +2001,8 @@ void CodeGenModule::EmitObjCPropertyImplementations(const } static bool needsDestructMethod(ObjCImplementationDecl *impl) { - ObjCInterfaceDecl *iface - = const_cast(impl->getClassInterface()); - for (ObjCIvarDecl *ivar = iface->all_declared_ivar_begin(); + const ObjCInterfaceDecl *iface = impl->getClassInterface(); + for (const ObjCIvarDecl *ivar = iface->all_declared_ivar_begin(); ivar; ivar = ivar->getNextIvar()) if (ivar->getType().isDestructedType()) return true; -- cgit v1.2.3-70-g09d2