aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-10 20:18:06 +0000
committerChris Lattner <sabre@nondot.org>2007-02-10 20:18:06 +0000
commita12bd03f0719f396e8f6e235ee80eb23e49a938c (patch)
tree897ba014f7089d7c24764a77a81ffabd540ac7de /lib/Target/TargetData.cpp
parent9182e3f2054a98084f2d263bacbddd98d12258bd (diff)
add a typedef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index c5b986eb72..805b754937 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -208,17 +208,18 @@ TargetData::TargetData(const Module *M) {
/// targets with cached elements should have been destroyed.
///
typedef std::pair<const TargetData*,const StructType*> LayoutKey;
-static ManagedStatic<std::map<LayoutKey, StructLayout*> > LayoutInfo;
+typedef std::map<LayoutKey, StructLayout*> LayoutInfoTy;
+static ManagedStatic<LayoutInfoTy> LayoutInfo;
TargetData::~TargetData() {
if (LayoutInfo.isConstructed()) {
// Remove any layouts for this TD.
- std::map<LayoutKey, StructLayout*> &TheMap = *LayoutInfo;
- std::map<LayoutKey, StructLayout*>::iterator
+ LayoutInfoTy &TheMap = *LayoutInfo;
+ LayoutInfoTy::iterator
I = TheMap.lower_bound(LayoutKey(this, (const StructType*)0));
- for (std::map<LayoutKey, StructLayout*>::iterator E = TheMap.end();
+ for (LayoutInfoTy::iterator E = TheMap.end();
I != E && I->first.first == this; ) {
I->second->~StructLayout();
free(I->second);
@@ -228,10 +229,9 @@ TargetData::~TargetData() {
}
const StructLayout *TargetData::getStructLayout(const StructType *Ty) const {
- std::map<LayoutKey, StructLayout*> &TheMap = *LayoutInfo;
+ LayoutInfoTy &TheMap = *LayoutInfo;
- std::map<LayoutKey, StructLayout*>::iterator
- I = TheMap.lower_bound(LayoutKey(this, Ty));
+ LayoutInfoTy::iterator I = TheMap.lower_bound(LayoutKey(this, Ty));
if (I != TheMap.end() && I->first.first == this && I->first.second == Ty)
return I->second;
@@ -253,8 +253,7 @@ const StructLayout *TargetData::getStructLayout(const StructType *Ty) const {
void TargetData::InvalidateStructLayoutInfo(const StructType *Ty) const {
if (!LayoutInfo.isConstructed()) return; // No cache.
- std::map<LayoutKey, StructLayout*>::iterator I =
- LayoutInfo->find(LayoutKey(this, Ty));
+ LayoutInfoTy::iterator I = LayoutInfo->find(LayoutKey(this, Ty));
if (I != LayoutInfo->end()) {
I->second->~StructLayout();
free(I->second);