AnonPointeeRegions are now identified by the MemRegion of the pointer pointing
to them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60868 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp
index 6aff286..22df07b 100644
--- a/lib/Analysis/MemRegion.cpp
+++ b/lib/Analysis/MemRegion.cpp
@@ -52,7 +52,7 @@
}
QualType AnonPointeeRegion::getType(ASTContext& C) const {
- QualType T = C.getCanonicalType(Pointer->getType());
+ QualType T = C.getCanonicalType(Pointer->getType(C));
PointerType* PTy = cast<PointerType>(T.getTypePtr());
QualType PointeeTy = C.getCanonicalType(PTy->getPointeeType());
@@ -60,10 +60,10 @@
}
void AnonPointeeRegion::ProfileRegion(llvm::FoldingSetNodeID& ID,
- const VarDecl* VD,
+ const TypedRegion* R,
const MemRegion* superRegion) {
ID.AddInteger((unsigned) AnonPointeeRegionKind);
- ID.AddPointer(VD);
+ ID.AddPointer(R);
ID.AddPointer(superRegion);
}
@@ -394,11 +394,11 @@
return R;
}
-AnonPointeeRegion* MemRegionManager::getAnonPointeeRegion(const VarDecl* d) {
+AnonPointeeRegion* MemRegionManager::getAnonPointeeRegion(const TypedRegion* r) {
llvm::FoldingSetNodeID ID;
MemRegion* superRegion = getUnknownRegion();
- AnonPointeeRegion::ProfileRegion(ID, d, superRegion);
+ AnonPointeeRegion::ProfileRegion(ID, r, superRegion);
void* InsertPos;
MemRegion* data = Regions.FindNodeOrInsertPos(ID, InsertPos);
@@ -406,7 +406,7 @@
if (!R) {
R = (AnonPointeeRegion*) A.Allocate<AnonPointeeRegion>();
- new (R) AnonPointeeRegion(d, superRegion);
+ new (R) AnonPointeeRegion(r, superRegion);
Regions.InsertNode(R, InsertPos);
}