[cfe-commits] r69775 - in /cfe/trunk/lib/CodeGen: CGExpr.cpp CGObjCGNU.cpp CGObjCMac.cpp CGObjCRuntime.h CodeGenFunction.h

Daniel Dunbar daniel at zuster.org
Tue Apr 21 22:08:16 PDT 2009


Author: ddunbar
Date: Wed Apr 22 00:08:15 2009
New Revision: 69775

URL: http://llvm.org/viewvc/llvm-project?rev=69775&view=rev
Log:
Make ObjCInterfaceDecl's const in some more places.

Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp
    cfe/trunk/lib/CodeGen/CGObjCRuntime.h
    cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=69775&r1=69774&r2=69775&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Wed Apr 22 00:08:15 2009
@@ -1129,7 +1129,7 @@
                           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);
 }

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=69775&r1=69774&r2=69775&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Apr 22 00:08:15 2009
@@ -148,7 +148,7 @@
                                       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 @@
 }
 
 llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
-                         ObjCInterfaceDecl *Interface,
+                         const ObjCInterfaceDecl *Interface,
                          const ObjCIvarDecl *Ivar) {
   const llvm::Type *InterfaceLTy =
     CGM.getTypes().ConvertType(

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=69775&r1=69774&r2=69775&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Apr 22 00:08:15 2009
@@ -963,7 +963,7 @@
                                       const ObjCIvarDecl *Ivar,
                                       unsigned CVRQualifiers);
   virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
-                                      ObjCInterfaceDecl *Interface,
+                                      const ObjCInterfaceDecl *Interface,
                                       const ObjCIvarDecl *Ivar);
 };
   
@@ -1152,7 +1152,7 @@
                                       const ObjCIvarDecl *Ivar,
                                       unsigned CVRQualifiers);
   virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
-                                      ObjCInterfaceDecl *Interface,
+                                      const ObjCInterfaceDecl *Interface,
                                       const ObjCIvarDecl *Ivar);
 };
   
@@ -2643,7 +2643,7 @@
 }
 
 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 @@
 const llvm::StructLayout *CGObjCCommonMac::GetInterfaceDeclStructLayout(
                                         const ObjCInterfaceDecl *OID) const {
   assert(!OID->isForwardDecl() && "Invalid interface decl!");
-  QualType T = 
-    CGM.getContext().getObjCInterfaceType(const_cast<ObjCInterfaceDecl*>(OID));
+  QualType T = CGM.getContext().getObjCInterfaceType(OID);
   const llvm::StructType *InterfaceTy = 
     cast<llvm::StructType>(CGM.getTypes().ConvertType(T));
   return CGM.getTargetData().getStructLayout(InterfaceTy);
@@ -4955,7 +4954,7 @@
 
 llvm::Value *CGObjCNonFragileABIMac::EmitIvarOffset(
                                        CodeGen::CodeGenFunction &CGF,
-                                       ObjCInterfaceDecl *Interface,
+                                       const ObjCInterfaceDecl *Interface,
                                        const ObjCIvarDecl *Ivar) {
   return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar), 
                                 false, "ivar");

Modified: cfe/trunk/lib/CodeGen/CGObjCRuntime.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCRuntime.h?rev=69775&r1=69774&r2=69775&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCRuntime.h (original)
+++ cfe/trunk/lib/CodeGen/CGObjCRuntime.h Wed Apr 22 00:08:15 2009
@@ -159,7 +159,7 @@
                                       const ObjCIvarDecl *Ivar,
                                       unsigned CVRQualifiers) = 0;
   virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
-                                      ObjCInterfaceDecl *Interface,
+                                      const ObjCInterfaceDecl *Interface,
                                       const ObjCIvarDecl *Ivar) = 0;
 };
 

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=69775&r1=69774&r2=69775&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Wed Apr 22 00:08:15 2009
@@ -623,7 +623,7 @@
   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);





More information about the cfe-commits mailing list