mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
345ce549a9
commit
49669e6d3a
@ -52,10 +52,6 @@ protected:
|
||||
///
|
||||
void dropAllTypeUses();
|
||||
|
||||
/// unlockedRefineAbstractTypeTo - Internal version of refineAbstractTypeTo
|
||||
/// that performs no locking. Only used for internal recursion.
|
||||
void unlockedRefineAbstractTypeTo(const Type *NewType);
|
||||
|
||||
public:
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
//
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user