mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-10 13:51:37 +00:00
Revert "unique_ptrify LLVMContextImpl::CAZConstants"
Missed the complexities of how these elements are destroyed. This reverts commit r222714. llvm-svn: 222715
This commit is contained in:
parent
14dc3c5b02
commit
de835e646d
@ -1330,12 +1330,12 @@ bool ConstantFP::isValueValidForType(Type *Ty, const APFloat& Val) {
|
|||||||
ConstantAggregateZero *ConstantAggregateZero::get(Type *Ty) {
|
ConstantAggregateZero *ConstantAggregateZero::get(Type *Ty) {
|
||||||
assert((Ty->isStructTy() || Ty->isArrayTy() || Ty->isVectorTy()) &&
|
assert((Ty->isStructTy() || Ty->isArrayTy() || Ty->isVectorTy()) &&
|
||||||
"Cannot create an aggregate zero of non-aggregate type!");
|
"Cannot create an aggregate zero of non-aggregate type!");
|
||||||
|
|
||||||
auto &Entry = Ty->getContext().pImpl->CAZConstants[Ty];
|
ConstantAggregateZero *&Entry = Ty->getContext().pImpl->CAZConstants[Ty];
|
||||||
if (!Entry)
|
if (!Entry)
|
||||||
Entry.reset(new ConstantAggregateZero(Ty));
|
Entry = new ConstantAggregateZero(Ty);
|
||||||
|
|
||||||
return Entry.get();
|
return Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// destroyConstant - Remove the constant from the constant table.
|
/// destroyConstant - Remove the constant from the constant table.
|
||||||
|
@ -87,7 +87,7 @@ LLVMContextImpl::~LLVMContextImpl() {
|
|||||||
ArrayConstants.freeConstants();
|
ArrayConstants.freeConstants();
|
||||||
StructConstants.freeConstants();
|
StructConstants.freeConstants();
|
||||||
VectorConstants.freeConstants();
|
VectorConstants.freeConstants();
|
||||||
CAZConstants.clear();
|
DeleteContainerSeconds(CAZConstants);
|
||||||
DeleteContainerSeconds(CPNConstants);
|
DeleteContainerSeconds(CPNConstants);
|
||||||
DeleteContainerSeconds(UVConstants);
|
DeleteContainerSeconds(UVConstants);
|
||||||
InlineAsms.freeConstants();
|
InlineAsms.freeConstants();
|
||||||
|
@ -299,10 +299,7 @@ public:
|
|||||||
// on Context destruction.
|
// on Context destruction.
|
||||||
SmallPtrSet<GenericMDNode *, 1> NonUniquedMDNodes;
|
SmallPtrSet<GenericMDNode *, 1> NonUniquedMDNodes;
|
||||||
|
|
||||||
// Value is indirected through pointer to keep pointer validity over mutations
|
DenseMap<Type*, ConstantAggregateZero*> CAZConstants;
|
||||||
// of this map. Replace if/when we have an efficient map that guarantees
|
|
||||||
// pointer validity over mutations.
|
|
||||||
DenseMap<Type*, std::unique_ptr<ConstantAggregateZero>> CAZConstants;
|
|
||||||
|
|
||||||
typedef ConstantUniqueMap<ConstantArray> ArrayConstantsTy;
|
typedef ConstantUniqueMap<ConstantArray> ArrayConstantsTy;
|
||||||
ArrayConstantsTy ArrayConstants;
|
ArrayConstantsTy ArrayConstants;
|
||||||
|
Loading…
Reference in New Issue
Block a user