aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-22 05:08:15 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-22 05:08:15 +0000
commit2a03192a02dbf4fdff438d1e658356bde871aba4 (patch)
tree737d38cc78c86e3d0b9cc9db6c057ac381bbd18c /lib/CodeGen
parent71dfdb9bc91b5d81b124e6091c903e4efd87149d (diff)
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGExpr.cpp2
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp4
-rw-r--r--lib/CodeGen/CGObjCMac.cpp11
-rw-r--r--lib/CodeGen/CGObjCRuntime.h2
-rw-r--r--lib/CodeGen/CodeGenFunction.h2
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<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 @@ 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);