summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-31 08:31:13 +0000
committerChris Lattner <sabre@nondot.org>2009-03-31 08:31:13 +0000
commitf71b69f7f351fa7d30a2b231fc137115d2772ad9 (patch)
tree108b692795309559ffca3937af52f65c4bd2ef81
parent4486c1fac04a97c91b7c0b066a9d7d1a47981659 (diff)
downloadbcm5719-llvm-f71b69f7f351fa7d30a2b231fc137115d2772ad9.tar.gz
bcm5719-llvm-f71b69f7f351fa7d30a2b231fc137115d2772ad9.zip
add a const version of the lookupFieldDeclForIvar method.
llvm-svn: 68094
-rw-r--r--clang/include/clang/AST/DeclObjC.h5
-rw-r--r--clang/lib/AST/ASTContext.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 76e4c0211e3..9acce0f5411 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -412,6 +412,11 @@ public:
FieldDecl *lookupFieldDeclForIvar(ASTContext &Context,
const ObjCIvarDecl *ivar);
+ const FieldDecl *lookupFieldDeclForIvar(ASTContext &Ctx,
+ const ObjCIvarDecl *IV) const {
+ return const_cast<ObjCInterfaceDecl*>(this)->lookupFieldDeclForIvar(Ctx,IV);
+ }
+
bool isForwardDecl() const { return ForwardDecl; }
void setForwardDecl(bool val) { ForwardDecl = val; }
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 18a3a4221aa..2e350c85024 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -650,9 +650,7 @@ const RecordDecl *ASTContext::addRecordToClass(const ObjCInterfaceDecl *D)
void ASTContext::setFieldDecl(const ObjCInterfaceDecl *OI,
const ObjCIvarDecl *Ivar,
const ObjCIvarRefExpr *MRef) {
- FieldDecl *FD = (const_cast<ObjCInterfaceDecl *>(OI))->
- lookupFieldDeclForIvar(*this, Ivar);
- ASTFieldForIvarRef[MRef] = FD;
+ ASTFieldForIvarRef[MRef] = OI->lookupFieldDeclForIvar(*this, Ivar);
}
/// getASTObjcInterfaceLayout - Get or compute information about the layout of
OpenPOWER on IntegriCloud