summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-20 00:37:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-20 00:37:55 +0000
commit5d5dbb17540f2ba79381e628e1e4e7ae70c4b0ea (patch)
tree7b6a145bed62a0f614e0485028e7cce5aef3ef6f /clang/lib
parentae03226bc6ec06927cbd91f59817d09876a8f301 (diff)
downloadbcm5719-llvm-5d5dbb17540f2ba79381e628e1e4e7ae70c4b0ea.tar.gz
bcm5719-llvm-5d5dbb17540f2ba79381e628e1e4e7ae70c4b0ea.zip
Remove non-const form of lookupFieldDeclForIvar.
llvm-svn: 69563
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/DeclObjC.cpp7
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp2
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp6
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp3
4 files changed, 11 insertions, 7 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 4bc7cd461cb..4a3c4d4f30e 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -375,11 +375,12 @@ ObjCInterfaceDecl::FindCategoryDeclaration(IdentifierInfo *CategoryId) const {
return 0;
}
-/// lookupFieldDeclForIvar - looks up a field decl' in the laid out
+/// lookupFieldDeclForIvar - looks up a field decl in the laid out
/// storage which matches this 'ivar'.
///
-FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context,
- const ObjCIvarDecl *IVar) {
+const FieldDecl *
+ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context,
+ const ObjCIvarDecl *IVar) const {
const RecordDecl *RecordForDecl = Context.addRecordToClass(this);
assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class");
DeclContext::lookup_const_result Lookup =
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 2ac4f9c7dfd..e22efa162ad 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -195,7 +195,7 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
Types.ConvertType(PD->getType())));
EmitReturnOfRValue(RV, PD->getType());
} else {
- FieldDecl *Field =
+ const FieldDecl *Field =
IMP->getClassInterface()->lookupFieldDeclForIvar(getContext(), Ivar);
LValue LV = EmitLValueForIvar(TypeOfSelfObject(),
LoadObjCSelf(), Ivar, Field, 0);
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index f7936fda554..2bbb15f0174 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -764,7 +764,8 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) {
Context.getObjCEncodingForType((*iter)->getType(), TypeStr);
IvarTypes.push_back(CGM.GetAddrOfConstantCString(TypeStr));
// Get the offset
- FieldDecl *Field = ClassDecl->lookupFieldDeclForIvar(Context, (*iter));
+ const FieldDecl *Field =
+ ClassDecl->lookupFieldDeclForIvar(Context, (*iter));
int offset =
(int)Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field));
IvarOffsets.push_back(
@@ -1105,7 +1106,8 @@ llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
CGM.getContext().getObjCInterfaceType(Interface));
const llvm::StructLayout *Layout =
CGM.getTargetData().getStructLayout(cast<llvm::StructType>(InterfaceLTy));
- FieldDecl *Field = Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
+ const FieldDecl *Field =
+ Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
uint64_t Offset =
Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field));
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index e04f723b1d7..e92796b5ba8 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -2400,7 +2400,8 @@ llvm::Value *CGObjCMac::EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
ObjCInterfaceDecl *Interface,
const ObjCIvarDecl *Ivar) {
const llvm::StructLayout *Layout = GetInterfaceDeclStructLayout(Interface);
- FieldDecl *Field = Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
+ const FieldDecl *Field =
+ Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
uint64_t Offset = GetIvarBaseOffset(Layout, Field);
return llvm::ConstantInt::get(
CGM.getTypes().ConvertType(CGM.getContext().LongTy),
OpenPOWER on IntegriCloud