remove the InvalidateStructLayoutInfo API, which is dead and unnecessary now
authorChris Lattner <sabre@nondot.org>
Fri, 15 Jul 2011 05:21:59 +0000 (05:21 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 15 Jul 2011 05:21:59 +0000 (05:21 +0000)
that type refinement is toast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135245 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Target.h
include/llvm/Target/TargetData.h
lib/Target/Target.cpp
lib/Target/TargetData.cpp

index 0c45ae51caa330f14e4d3e49aa631a276a423751..d21644011ad48e503dfc9e2209cada1e0b05dbbd 100644 (file)
@@ -147,12 +147,6 @@ unsigned LLVMElementAtOffset(LLVMTargetDataRef, LLVMTypeRef StructTy,
 unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy,
                                        unsigned Element);
 
-/** Struct layouts are speculatively cached. If a TargetDataRef is alive when
-    types are being refined and removed, this method must be called whenever a
-    struct type is removed to avoid a dangling pointer in this cache.
-    See the method llvm::TargetData::InvalidateStructLayoutInfo. */
-void LLVMInvalidateStructLayout(LLVMTargetDataRef, LLVMTypeRef StructTy);
-
 /** Deallocates a TargetData.
     See the destructor llvm::TargetData::~TargetData. */
 void LLVMDisposeTargetData(LLVMTargetDataRef);
index 10252865c966cddf02f0ee835e5599bdf988ed29..c28081000d71db69dac3a0392fe3effb55d75f5b 100644 (file)
@@ -272,12 +272,6 @@ public:
   /// information is lazily cached.
   const StructLayout *getStructLayout(const StructType *Ty) const;
 
-  /// InvalidateStructLayoutInfo - TargetData speculatively caches StructLayout
-  /// objects.  If a TargetData object is alive when types are being refined and
-  /// removed, this method must be called whenever a StructType is removed to
-  /// avoid a dangling pointer in this cache.
-  void InvalidateStructLayoutInfo(const StructType *Ty) const;
-
   /// getPreferredAlignment - Return the preferred alignment of the specified
   /// global.  This includes an explicitly requested alignment (if the global
   /// has one).
index 0919fe42dc0e553abb9b42be4892eeb68cbb56b5..a42ce548c895529205902916ac1601c8d3151609 100644 (file)
@@ -97,10 +97,6 @@ unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructT
   return unwrap(TD)->getStructLayout(STy)->getElementOffset(Element);
 }
 
-void LLVMInvalidateStructLayout(LLVMTargetDataRef TD, LLVMTypeRef StructTy) {
-  unwrap(TD)->InvalidateStructLayoutInfo(unwrap<StructType>(StructTy));
-}
-
 void LLVMDisposeTargetData(LLVMTargetDataRef TD) {
   delete unwrap(TD);
 }
index b2c4b21f680daa23ec33e756b0bee4adbf6e2098..17d022a339e69b7dbf7d357a0f4b2d096464c0c8 100644 (file)
@@ -329,15 +329,6 @@ public:
     }
   }
 
-  void InvalidateEntry(const StructType *Ty) {
-    LayoutInfoTy::iterator I = LayoutInfo.find(Ty);
-    if (I == LayoutInfo.end()) return;
-    
-    I->second->~StructLayout();
-    free(I->second);
-    LayoutInfo.erase(I);
-  }
-
   StructLayout *&operator[](const StructType *STy) {
     return LayoutInfo[STy];
   }
@@ -375,16 +366,6 @@ const StructLayout *TargetData::getStructLayout(const StructType *Ty) const {
   return L;
 }
 
-/// InvalidateStructLayoutInfo - TargetData speculatively caches StructLayout
-/// objects.  If a TargetData object is alive when types are being refined and
-/// removed, this method must be called whenever a StructType is removed to
-/// avoid a dangling pointer in this cache.
-void TargetData::InvalidateStructLayoutInfo(const StructType *Ty) const {
-  if (!LayoutMap) return;  // No cache.
-
-  static_cast<StructLayoutMap*>(LayoutMap)->InvalidateEntry(Ty);
-}
-
 std::string TargetData::getStringRepresentation() const {
   std::string Result;
   raw_string_ostream OS(Result);