From e607ed068334bacb8d7b093996b4671c6ca79e25 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Fri, 7 Aug 2009 18:05:12 +0000 Subject: Fix some const_cast issues. This is the beginning of the rabbit hole. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78393 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenTypes.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/CodeGenTypes.cpp') diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index 0cb0c72f2e..7b1b85c64c 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -121,8 +121,7 @@ static const TagType *VerifyFuncTypeComplete(const Type* T) { /// UpdateCompletedType - When we find the full definition for a TagDecl, /// replace the 'opaque' type we previously made for it if applicable. void CodeGenTypes::UpdateCompletedType(const TagDecl *TD) { - const Type *Key = - Context.getTagDeclType(const_cast(TD)).getTypePtr(); + const Type *Key = Context.getTagDeclType(TD).getTypePtr(); llvm::DenseMap::iterator TDTI = TagDeclTypes.find(Key); if (TDTI == TagDeclTypes.end()) return; @@ -395,7 +394,7 @@ const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) { // TagDecl's are not necessarily unique, instead use the (clang) // type connected to the decl. const Type *Key = - Context.getTagDeclType(const_cast(TD)).getTypePtr(); + Context.getTagDeclType(TD).getTypePtr(); llvm::DenseMap::iterator TDTI = TagDeclTypes.find(Key); @@ -478,7 +477,7 @@ void CodeGenTypes::addBitFieldInfo(const FieldDecl *FD, unsigned FieldNo, const CGRecordLayout * CodeGenTypes::getCGRecordLayout(const TagDecl *TD) const { const Type *Key = - Context.getTagDeclType(const_cast(TD)).getTypePtr(); + Context.getTagDeclType(TD).getTypePtr(); llvm::DenseMap::iterator I = CGRecordLayouts.find(Key); assert (I != CGRecordLayouts.end() -- cgit v1.2.3