aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-22 04:34:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-22 04:34:53 +0000
commit3b3a45858c6b2a45114e91902c3bf3c4b7f5f302 (patch)
tree54671de9671cbf371b1b627d55371e29524f55c0 /lib
parent0c45793173ebdf15ba7345a1f71919c47abbeed0 (diff)
Mark another TypeForDecl const and make getObjCInterfaceType's argument const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69772 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/ASTContext.cpp5
-rw-r--r--lib/AST/DeclObjC.cpp2
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp3
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index a3a2778860..af7cf124ef 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1383,10 +1383,11 @@ QualType ASTContext::getTypedefType(TypedefDecl *Decl) {
/// getObjCInterfaceType - Return the unique reference to the type for the
/// specified ObjC interface decl.
-QualType ASTContext::getObjCInterfaceType(ObjCInterfaceDecl *Decl) {
+QualType ASTContext::getObjCInterfaceType(const ObjCInterfaceDecl *Decl) {
if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0);
- Decl->TypeForDecl = new(*this,8) ObjCInterfaceType(Type::ObjCInterface, Decl);
+ ObjCInterfaceDecl *OID = const_cast<ObjCInterfaceDecl*>(Decl);
+ Decl->TypeForDecl = new(*this,8) ObjCInterfaceType(Type::ObjCInterface, OID);
Types.push_back(Decl->TypeForDecl);
return QualType(Decl->TypeForDecl, 0);
}
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index be23e3039d..de10230991 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -277,7 +277,7 @@ void ObjCMethodDecl::createImplicitParams(ASTContext &Context,
// There may be no interface context due to error in declaration
// of the interface (which has been reported). Recover gracefully.
if (OID) {
- selfTy =Context.getObjCInterfaceType(const_cast<ObjCInterfaceDecl*>(OID));
+ selfTy = Context.getObjCInterfaceType(OID);
selfTy = Context.getPointerType(selfTy);
} else {
selfTy = Context.getObjCIdType();
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 984e49e120..5d98b453ac 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -199,8 +199,7 @@ void CodeGenTypes::UpdateCompletedType(const TagDecl *TD) {
void CodeGenTypes::UpdateCompletedType(const ObjCInterfaceDecl *OID) {
// Check to see if we have already laid this type out, if not, just return.
- QualType OIDTy =
- Context.getObjCInterfaceType(const_cast<ObjCInterfaceDecl*>(OID));
+ QualType OIDTy = Context.getObjCInterfaceType(OID);
llvm::DenseMap<Type *, llvm::PATypeHolder>::iterator TCI =
TypeCache.find(OIDTy.getTypePtr());
if (TCI == TypeCache.end()) return;