diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-12-05 07:46:49 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-12-05 07:46:49 +0000 |
commit | 32bc2362a156d2c3a9c8224b6a238f1a41a3c496 (patch) | |
tree | 3bb8eb4332c598bf02b74a229e66bfef3d4cc66d /lib | |
parent | dc492e037034e7671e3fb9ab3e041186cdc97508 (diff) | |
download | external_llvm-32bc2362a156d2c3a9c8224b6a238f1a41a3c496.zip external_llvm-32bc2362a156d2c3a9c8224b6a238f1a41a3c496.tar.gz external_llvm-32bc2362a156d2c3a9c8224b6a238f1a41a3c496.tar.bz2 |
Final cleanups:
- Privatize a typedef.
- Call the InvalidateEntry when refining a type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/TargetData.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 2c1c5e6..2a5b572 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -318,9 +318,7 @@ unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType, namespace { class StructLayoutMap : public AbstractTypeUser { -public: typedef DenseMap<const StructType*, StructLayout*> LayoutInfoTy; -private: LayoutInfoTy LayoutInfo; /// refineAbstractType - The callback method invoked when an abstract type is @@ -329,12 +327,7 @@ private: /// virtual void refineAbstractType(const DerivedType *OldTy, const Type *) { - 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); + InvalidateEntry(cast<const StructType>(OldTy)); } /// typeBecameConcrete - The other case which AbstractTypeUsers must be aware @@ -343,12 +336,7 @@ private: /// This method notifies ATU's when this occurs for a type. /// virtual void typeBecameConcrete(const DerivedType *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); + InvalidateEntry(cast<const StructType>(AbsTy)); } public: |