From 2a03192a02dbf4fdff438d1e658356bde871aba4 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 22 Apr 2009 05:08:15 +0000 Subject: [PATCH] Make ObjCInterfaceDecl's const in some more places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69775 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 2 +- lib/CodeGen/CGObjCGNU.cpp | 4 ++-- lib/CodeGen/CGObjCMac.cpp | 11 +++++------ lib/CodeGen/CGObjCRuntime.h | 2 +- lib/CodeGen/CodeGenFunction.h | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 3ca625cc72..67b6e4c3d7 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1129,7 +1129,7 @@ LValue CodeGenFunction::EmitObjCMessageExprLValue(const ObjCMessageExpr *E) { getContext().getObjCGCAttrKind(E->getType())); } -llvm::Value *CodeGenFunction::EmitIvarOffset(ObjCInterfaceDecl *Interface, +llvm::Value *CodeGenFunction::EmitIvarOffset(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar) { return CGM.getObjCRuntime().EmitIvarOffset(*this, Interface, Ivar); } diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 167e337386..a1bc9b7ad4 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -148,7 +148,7 @@ public: const ObjCIvarDecl *Ivar, unsigned CVRQualifiers); virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar); }; } // end anonymous namespace @@ -1096,7 +1096,7 @@ LValue CGObjCGNU::EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF, } llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar) { const llvm::Type *InterfaceLTy = CGM.getTypes().ConvertType( diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index e0f4492513..d3ac8c92e2 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -963,7 +963,7 @@ private: const ObjCIvarDecl *Ivar, unsigned CVRQualifiers); virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar); }; @@ -1152,7 +1152,7 @@ public: const ObjCIvarDecl *Ivar, unsigned CVRQualifiers); virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar); }; @@ -2643,7 +2643,7 @@ LValue CGObjCMac::EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF, } llvm::Value *CGObjCMac::EmitIvarOffset(CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar) { const llvm::StructLayout *Layout = GetInterfaceDeclStructLayout(Interface); const FieldDecl *Field = @@ -2827,8 +2827,7 @@ llvm::Constant *CGObjCCommonMac::GetClassName(IdentifierInfo *Ident) { const llvm::StructLayout *CGObjCCommonMac::GetInterfaceDeclStructLayout( const ObjCInterfaceDecl *OID) const { assert(!OID->isForwardDecl() && "Invalid interface decl!"); - QualType T = - CGM.getContext().getObjCInterfaceType(const_cast(OID)); + QualType T = CGM.getContext().getObjCInterfaceType(OID); const llvm::StructType *InterfaceTy = cast(CGM.getTypes().ConvertType(T)); return CGM.getTargetData().getStructLayout(InterfaceTy); @@ -4955,7 +4954,7 @@ LValue CGObjCNonFragileABIMac::EmitObjCValueForIvar( llvm::Value *CGObjCNonFragileABIMac::EmitIvarOffset( CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar) { return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar), false, "ivar"); diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h index 4faa89410d..cae32edf04 100644 --- a/lib/CodeGen/CGObjCRuntime.h +++ b/lib/CodeGen/CGObjCRuntime.h @@ -159,7 +159,7 @@ public: const ObjCIvarDecl *Ivar, unsigned CVRQualifiers) = 0; virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF, - ObjCInterfaceDecl *Interface, + const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar) = 0; }; diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index a0f38af42b..32001ceab3 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -623,7 +623,7 @@ public: LValue EmitConditionalOperator(const ConditionalOperator *E); LValue EmitCastLValue(const CastExpr *E); - llvm::Value *EmitIvarOffset(ObjCInterfaceDecl *Interface, + llvm::Value *EmitIvarOffset(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar); LValue EmitLValueForField(llvm::Value* Base, FieldDecl* Field, bool isUnion, unsigned CVRQualifiers); -- 2.40.0