[cfe-commits] r46809 - in /cfe/trunk/CodeGen: CodeGenTypes.cpp CodeGenTypes.h

Chris Lattner sabre at nondot.org
Tue Feb 5 22:06:50 PST 2008


Author: lattner
Date: Wed Feb  6 00:06:49 2008
New Revision: 46809

URL: http://llvm.org/viewvc/llvm-project?rev=46809&view=rev
Log:
now that ConvertTagDeclType is nice and simple, use it from UpdateCompletedType.

Modified:
    cfe/trunk/CodeGen/CodeGenTypes.cpp
    cfe/trunk/CodeGen/CodeGenTypes.h

Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=46809&r1=46808&r2=46809&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Wed Feb  6 00:06:49 2008
@@ -139,13 +139,11 @@
   // Remove it from TagDeclTypes so that it will be regenerated.
   TagDeclTypes.erase(TDTI);
 
-  QualType NewTy = Context.getTagDeclType(const_cast<TagDecl*>(TD));
-  const llvm::Type *NT = ConvertNewType(NewTy);
+  // Generate the new type.
+  const llvm::Type *NT = ConvertTagDeclType(TD);
 
-  // If getting the type didn't itself refine it, refine it to its actual type
-  // now.
-  if (llvm::OpaqueType *OT = dyn_cast<llvm::OpaqueType>(OpaqueHolder.get()))
-    OT->refineAbstractTypeTo(NT);
+  // Refine the old opaque type to its new definition.
+  cast<llvm::OpaqueType>(OpaqueHolder.get())->refineAbstractTypeTo(NT);
 }
 
 
@@ -279,7 +277,7 @@
 
   case Type::Tagged: {
     const TagDecl *TD = cast<TagType>(Ty).getDecl();
-    const llvm::Type *Res = ConvertTagDeclType(T, TD);
+    const llvm::Type *Res = ConvertTagDeclType(TD);
     
     std::string TypeName(TD->getKindName());
     TypeName += '.';
@@ -316,8 +314,7 @@
 
 /// ConvertTagDeclType - Lay out a tagged decl type like struct or union or
 /// enum.
-const llvm::Type *CodeGenTypes::ConvertTagDeclType(QualType T,
-                                                   const TagDecl *TD) {
+const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) {
   llvm::DenseMap<const TagDecl*, llvm::PATypeHolder>::iterator TDTI = 
     TagDeclTypes.find(TD);
   

Modified: cfe/trunk/CodeGen/CodeGenTypes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.h?rev=46809&r1=46808&r2=46809&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.h (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.h Wed Feb  6 00:06:49 2008
@@ -156,7 +156,7 @@
 
   /// ConvertTagDeclType - Lay out a tagged decl type like struct or union or
   /// enum.
-  const llvm::Type *ConvertTagDeclType(QualType T, const TagDecl *TD);
+  const llvm::Type *ConvertTagDeclType(const TagDecl *TD);
 };
 
 }  // end namespace CodeGen





More information about the cfe-commits mailing list