summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2011-07-22 02:08:32 +0000
committerJordy Rose <jediknil@belkadan.com>2011-07-22 02:08:32 +0000
commita91768e56977920cbe9723c8f3f5371e3d37d379 (patch)
tree2ac709e8609e081306827eed45149fa419de0eeb /clang/lib/AST/RecordLayoutBuilder.cpp
parentdff8de77a611f93712df6bcfb54c2e0bed599f02 (diff)
downloadbcm5719-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/AST/RecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index 5636a6f0f64..c064d124b49 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -1242,10 +1242,9 @@ void RecordLayoutBuilder::Layout(const ObjCInterfaceDecl *D) {
}
InitializeLayout(D);
- ObjCInterfaceDecl *OI = const_cast<ObjCInterfaceDecl*>(D);
// Layout each ivar sequentially.
- for (ObjCIvarDecl *IVD = OI->all_declared_ivar_begin();
- IVD; IVD = IVD->getNextIvar())
+ for (const ObjCIvarDecl *IVD = D->all_declared_ivar_begin(); IVD;
+ IVD = IVD->getNextIvar())
LayoutField(IVD);
// Finally, round the size of the total struct up to the alignment of the
OpenPOWER on IntegriCloud