[llvm-commits] [llvm] r90639 - /llvm/trunk/lib/Target/TargetData.cpp
Bill Wendling
isanbard at gmail.com
Fri Dec 4 17:43:34 PST 2009
Author: void
Date: Fri Dec 4 19:43:33 2009
New Revision: 90639
URL: http://llvm.org/viewvc/llvm-project?rev=90639&view=rev
Log:
Refactor some code. No functionality change.
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=90639&r1=90638&r2=90639&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetData.cpp (original)
+++ llvm/trunk/lib/Target/TargetData.cpp Fri Dec 4 19:43:33 2009
@@ -367,6 +367,18 @@
}
}
+ void InvalidateEntry(const StructType *Ty) {
+ LayoutInfoTy::iterator I = this->find(Ty);
+ if (I == this->end()) return;
+
+ I->second->~StructLayout();
+ free(I->second);
+ this->erase(I);
+
+ if (Ty->isAbstract())
+ Ty->removeAbstractTypeUser(this);
+ }
+
LayoutInfoTy::iterator end() {
return LayoutInfo.end();
}
@@ -427,15 +439,7 @@
if (!LayoutMap) return; // No cache.
StructLayoutMap *STM = static_cast<StructLayoutMap*>(LayoutMap);
- StructLayoutMap::LayoutInfoTy::iterator I = STM->find(Ty);
- if (I == STM->end()) return;
-
- I->second->~StructLayout();
- free(I->second);
- STM->erase(I);
-
- if (Ty->isAbstract())
- Ty->removeAbstractTypeUser(STM);
+ STM->InvalidateEntry(Ty);
}
std::string TargetData::getStringRepresentation() const {
More information about the llvm-commits
mailing list