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 | db8264e4c5ffd7af6fbad4ca4306bd382bb02691 (patch) | |
tree | 51952881a328e6fe048573df4968254aec9e4595 /lib/Sema/SemaDeclObjC.cpp | |
parent | 527eec86ce96695a7198073e574bf4a184848d24 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 43f9c78592..d754cffcc5 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -2533,11 +2533,11 @@ void Sema::ActOnDefs(Scope *S, Decl *TagD, SourceLocation DeclStart, } // Collect the instance variables - llvm::SmallVector<ObjCIvarDecl*, 32> Ivars; + SmallVector<const ObjCIvarDecl*, 32> Ivars; Context.DeepCollectObjCIvars(Class, true, Ivars); // For each ivar, create a fresh ObjCAtDefsFieldDecl. for (unsigned i = 0; i < Ivars.size(); i++) { - FieldDecl* ID = cast<FieldDecl>(Ivars[i]); + const FieldDecl* ID = cast<FieldDecl>(Ivars[i]); RecordDecl *Record = dyn_cast<RecordDecl>(TagD); Decl *FD = ObjCAtDefsFieldDecl::Create(Context, Record, /*FIXME: StartL=*/ID->getLocation(), |