mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Fix some problems with ASTCallbackVH in its use as a DenseMap key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77696 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
29384efb76
commit
a818c30d66
@ -259,12 +259,19 @@ class AliasSetTracker {
|
|||||||
virtual void deleted();
|
virtual void deleted();
|
||||||
public:
|
public:
|
||||||
ASTCallbackVH(Value *V, AliasSetTracker *AST = 0);
|
ASTCallbackVH(Value *V, AliasSetTracker *AST = 0);
|
||||||
|
ASTCallbackVH &operator=(Value *V);
|
||||||
|
};
|
||||||
|
/// ASTCallbackVHDenseMapInfo - Traits to tell DenseMap that ASTCallbackVH
|
||||||
|
/// is not a POD (it needs its destructor called).
|
||||||
|
struct ASTCallbackVHDenseMapInfo : public DenseMapInfo<Value *> {
|
||||||
|
static bool isPod() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
AliasAnalysis &AA;
|
AliasAnalysis &AA;
|
||||||
ilist<AliasSet> AliasSets;
|
ilist<AliasSet> AliasSets;
|
||||||
|
|
||||||
typedef DenseMap<ASTCallbackVH, AliasSet::PointerRec*, DenseMapInfo<Value*> >
|
typedef DenseMap<ASTCallbackVH, AliasSet::PointerRec*,
|
||||||
|
ASTCallbackVHDenseMapInfo>
|
||||||
PointerMapType;
|
PointerMapType;
|
||||||
|
|
||||||
// Map from pointers to their node
|
// Map from pointers to their node
|
||||||
|
@ -586,10 +586,12 @@ void AliasSetTracker::ASTCallbackVH::deleted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AliasSetTracker::ASTCallbackVH::ASTCallbackVH(Value *V, AliasSetTracker *ast)
|
AliasSetTracker::ASTCallbackVH::ASTCallbackVH(Value *V, AliasSetTracker *ast)
|
||||||
: CallbackVH(V == DenseMapInfo<Value *>::getEmptyKey() ? 0 :
|
: CallbackVH(V), AST(ast) {}
|
||||||
V == DenseMapInfo<Value *>::getTombstoneKey() ? 0 :
|
|
||||||
V),
|
AliasSetTracker::ASTCallbackVH &
|
||||||
AST(ast) {}
|
AliasSetTracker::ASTCallbackVH::operator=(Value *V) {
|
||||||
|
return *this = ASTCallbackVH(V, AST);
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// AliasSetPrinter Pass
|
// AliasSetPrinter Pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user