summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-16 20:50:13 +0000
committerChris Lattner <sabre@nondot.org>2010-07-16 20:50:13 +0000
commit27e997a168592572176ef7117c62dcdcb24cb120 (patch)
tree07bb3635d697f4b521604df22cc8f89db77b064e /llvm/lib
parent0030be81f57c3d2eb36f5cebfe8e92bc5afa7899 (diff)
downloadbcm5719-llvm-27e997a168592572176ef7117c62dcdcb24cb120.tar.gz
bcm5719-llvm-27e997a168592572176ef7117c62dcdcb24cb120.zip
eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement. llvm-svn: 108553
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp2
-rw-r--r--llvm/lib/VMCore/Type.cpp13
-rw-r--r--llvm/lib/VMCore/TypesContext.h4
3 files changed, 5 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 735a1c47c39..1fb9e649653 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1467,7 +1467,7 @@ static bool TryToOptimizeStoreOfMallocToGlobal(GlobalVariable *GV,
TargetData *TD) {
if (!TD)
return false;
-
+
// If this is a malloc of an abstract type, don't touch it.
if (!AllocTy->isSized())
return false;
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 845b523c242..83e018c97d9 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -1128,13 +1128,13 @@ void Type::removeAbstractTypeUser(AbstractTypeUser *U) const {
}
-// unlockedRefineAbstractTypeTo - This function is used when it is discovered
+// refineAbstractTypeTo - This function is used when it is discovered
// that the 'this' abstract type is actually equivalent to the NewType
// specified. This causes all users of 'this' to switch to reference the more
// concrete type NewType and for 'this' to be deleted. Only used for internal
// callers.
//
-void DerivedType::unlockedRefineAbstractTypeTo(const Type *NewType) {
+void DerivedType::refineAbstractTypeTo(const Type *NewType) {
assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!");
assert(this != NewType && "Can't refine to myself!");
assert(ForwardType == 0 && "This type has already been refined!");
@@ -1199,15 +1199,6 @@ void DerivedType::unlockedRefineAbstractTypeTo(const Type *NewType) {
// destroyed.
}
-// refineAbstractTypeTo - This function is used by external callers to notify
-// us that this abstract type is equivalent to another type.
-//
-void DerivedType::refineAbstractTypeTo(const Type *NewType) {
- // All recursive calls will go through unlockedRefineAbstractTypeTo,
- // to avoid deadlock problems.
- unlockedRefineAbstractTypeTo(NewType);
-}
-
// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type that
// the current type has transitioned from being abstract to being concrete.
//
diff --git a/llvm/lib/VMCore/TypesContext.h b/llvm/lib/VMCore/TypesContext.h
index 02ab1135b32..e9f7d835972 100644
--- a/llvm/lib/VMCore/TypesContext.h
+++ b/llvm/lib/VMCore/TypesContext.h
@@ -370,7 +370,7 @@ public:
// We already have this type in the table. Get rid of the newly refined
// type.
TypeClass *NewTy = cast<TypeClass>((Type*)I->second.get());
- Ty->unlockedRefineAbstractTypeTo(NewTy);
+ Ty->refineAbstractTypeTo(NewTy);
return;
}
} else {
@@ -406,7 +406,7 @@ public:
}
TypesByHash.erase(Entry);
}
- Ty->unlockedRefineAbstractTypeTo(NewTy);
+ Ty->refineAbstractTypeTo(NewTy);
return;
}
}
OpenPOWER on IntegriCloud