Calling InvalidateEntry during the refinement was breaking the bootstrap.
authorBill Wendling <isanbard@gmail.com>
Sat, 5 Dec 2009 07:59:04 +0000 (07:59 +0000)
committerBill Wendling <isanbard@gmail.com>
Sat, 5 Dec 2009 07:59:04 +0000 (07:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90656 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/TargetData.cpp

index 2a5b572a115ea37a069d69e5cff3bef7468603bb..9434a1901ffde3be18730c0016682bcb9b5ccb91 100644 (file)
@@ -327,7 +327,12 @@ class StructLayoutMap : public AbstractTypeUser {
   ///
   virtual void refineAbstractType(const DerivedType *OldTy,
                                   const Type *) {
-    InvalidateEntry(cast<const StructType>(OldTy));
+    const StructType *STy = cast<const StructType>(OldTy);
+    LayoutInfoTy::iterator Iter = LayoutInfo.find(STy);
+    Iter->second->~StructLayout();
+    free(Iter->second);
+    LayoutInfo.erase(Iter);
+    OldTy->removeAbstractTypeUser(this);
   }
 
   /// typeBecameConcrete - The other case which AbstractTypeUsers must be aware
@@ -336,7 +341,12 @@ class StructLayoutMap : public AbstractTypeUser {
   /// This method notifies ATU's when this occurs for a type.
   ///
   virtual void typeBecameConcrete(const DerivedType *AbsTy) {
-    InvalidateEntry(cast<const StructType>(AbsTy));
+    const StructType *STy = cast<const StructType>(AbsTy);
+    LayoutInfoTy::iterator Iter = LayoutInfo.find(STy);
+    Iter->second->~StructLayout();
+    free(Iter->second);
+    LayoutInfo.erase(Iter);
+    AbsTy->removeAbstractTypeUser(this);
   }
 
 public: