diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-12-11 02:27:34 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-12-11 02:27:34 +0000 |
commit | 3bb662a8635a1f85a64719759ead76abffe0e172 (patch) | |
tree | 4acea5a5b36a3b2d37bd718293055c8ae2ebfe8d /lib/Analysis/MemRegion.cpp | |
parent | 83df2d230166fed729797b112f5faf27fce2bdd5 (diff) |
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
Diffstat (limited to 'lib/Analysis/MemRegion.cpp')
-rw-r--r-- | lib/Analysis/MemRegion.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp index 6aff286dc1..22df07b716 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Analysis/MemRegion.cpp @@ -52,7 +52,7 @@ void AnonTypedRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T, } 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 @@ QualType AnonPointeeRegion::getType(ASTContext& C) const { } 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 @@ MemRegionManager::getAnonTypedRegion(QualType t, const MemRegion* superRegion) { 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 @@ AnonPointeeRegion* MemRegionManager::getAnonPointeeRegion(const VarDecl* d) { if (!R) { R = (AnonPointeeRegion*) A.Allocate<AnonPointeeRegion>(); - new (R) AnonPointeeRegion(d, superRegion); + new (R) AnonPointeeRegion(r, superRegion); Regions.InsertNode(R, InsertPos); } |