aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm-c/Target.h6
-rw-r--r--include/llvm/Target/TargetData.h6
-rw-r--r--lib/Target/Target.cpp4
-rw-r--r--lib/Target/TargetData.cpp19
4 files changed, 0 insertions, 35 deletions
diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h
index 0c45ae51ca..d21644011a 100644
--- a/include/llvm-c/Target.h
+++ b/include/llvm-c/Target.h
@@ -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);
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 10252865c9..c28081000d 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -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).
diff --git a/lib/Target/Target.cpp b/lib/Target/Target.cpp
index 0919fe42dc..a42ce548c8 100644
--- a/lib/Target/Target.cpp
+++ b/lib/Target/Target.cpp
@@ -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);
}
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index b2c4b21f68..17d022a339 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -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);