summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-31 08:33:16 +0000
committerChris Lattner <sabre@nondot.org>2009-03-31 08:33:16 +0000
commit06ae0e2c3bda2294e69f6c00ea297fc0eeab4c07 (patch)
tree628330af97a204a54502432bdf2422c3afc254b8
parentf71b69f7f351fa7d30a2b231fc137115d2772ad9 (diff)
downloadbcm5719-llvm-06ae0e2c3bda2294e69f6c00ea297fc0eeab4c07.tar.gz
bcm5719-llvm-06ae0e2c3bda2294e69f6c00ea297fc0eeab4c07.zip
small cleanups.
llvm-svn: 68095
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index c15c3bb1e7d..8bbd1b4cafa 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -456,12 +456,12 @@ protected:
/// GetIvarBaseOffset - returns ivars byte offset.
uint64_t GetIvarBaseOffset(const llvm::StructLayout *Layout,
- FieldDecl *Field);
+ const FieldDecl *Field);
- /// GetFieldBaseOffset - return's field byt offset.
+ /// GetFieldBaseOffset - return's field byte offset.
uint64_t GetFieldBaseOffset(const ObjCInterfaceDecl *OI,
const llvm::StructLayout *Layout,
- FieldDecl *Field);
+ const FieldDecl *Field);
/// CreateMetadataVar - Create a global variable with internal
/// linkage for use by the Objective-C runtime.
@@ -1829,7 +1829,7 @@ llvm::Function *CGObjCCommonMac::GenerateMethod(const ObjCMethodDecl *OMD,
}
uint64_t CGObjCCommonMac::GetIvarBaseOffset(const llvm::StructLayout *Layout,
- FieldDecl *Field) {
+ const FieldDecl *Field) {
if (!Field->isBitField())
return Layout->getElementOffset(
CGM.getTypes().getLLVMFieldNo(Field));
@@ -1844,12 +1844,10 @@ uint64_t CGObjCCommonMac::GetIvarBaseOffset(const llvm::StructLayout *Layout,
/// GetFieldBaseOffset - return's field byt offset.
uint64_t CGObjCCommonMac::GetFieldBaseOffset(const ObjCInterfaceDecl *OI,
const llvm::StructLayout *Layout,
- FieldDecl *Field) {
+ const FieldDecl *Field) {
const ObjCIvarDecl *Ivar = cast<ObjCIvarDecl>(Field);
- Field = const_cast<ObjCInterfaceDecl*>(OI)->lookupFieldDeclForIvar(
- CGM.getContext(), Ivar);
- uint64_t Offset = GetIvarBaseOffset(Layout, Field);
- return Offset;
+ const FieldDecl *FD = OI->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
+ return GetIvarBaseOffset(Layout, FD);
}
llvm::GlobalVariable *
OpenPOWER on IntegriCloud