[llvm-commits] [llvm] r90655 - /llvm/trunk/lib/Target/TargetData.cpp
Bill Wendling
isanbard at gmail.com
Fri Dec 4 23:46:49 PST 2009
Author: void
Date: Sat Dec 5 01:46:49 2009
New Revision: 90655
URL: http://llvm.org/viewvc/llvm-project?rev=90655&view=rev
Log:
Final cleanups:
- Privatize a typedef.
- Call the InvalidateEntry when refining a type.
Modified:
llvm/trunk/lib/Target/TargetData.cpp
Modified: llvm/trunk/lib/Target/TargetData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=90655&r1=90654&r2=90655&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetData.cpp (original)
+++ llvm/trunk/lib/Target/TargetData.cpp Sat Dec 5 01:46:49 2009
@@ -318,9 +318,7 @@
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 @@
///
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 @@
/// 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:
More information about the llvm-commits
mailing list