aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-10-27 13:35:03 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-10-27 13:35:03 +0000
commite70559fd25bfd1970a82086c5f99cf9ef181b1ae (patch)
tree9375e0a5f189600d2106c272173c506d2440bb53
parent27b57063d83b00474d7563fb5d608544e2364862 (diff)
Use ASTContext::getCanonicalType() to get TypedRegion's type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58247 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/MemRegion.h14
-rw-r--r--lib/Analysis/RegionStore.cpp2
2 files changed, 10 insertions, 6 deletions
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h
index 5142427b45..4465796f9c 100644
--- a/include/clang/Analysis/PathSensitive/MemRegion.h
+++ b/include/clang/Analysis/PathSensitive/MemRegion.h
@@ -154,8 +154,8 @@ protected:
const MemRegion* superRegion);
public:
- QualType getType(ASTContext&) const {
- return Str->getType();
+ QualType getType(ASTContext& C) const {
+ return C.getCanonicalType(Str->getType());
}
void Profile(llvm::FoldingSetNodeID& ID) const {
@@ -182,7 +182,7 @@ protected:
const MemRegion* superRegion);
public:
- QualType getType(ASTContext&) const { return T; }
+ QualType getType(ASTContext& C) const { return C.getCanonicalType(T); }
void Profile(llvm::FoldingSetNodeID& ID) const;
@@ -247,7 +247,9 @@ class VarRegion : public DeclRegion {
public:
const VarDecl* getDecl() const { return cast<VarDecl>(D); }
- QualType getType(ASTContext&) const { return getDecl()->getType(); }
+ QualType getType(ASTContext& C) const {
+ return C.getCanonicalType(getDecl()->getType());
+ }
void print(llvm::raw_ostream& os) const;
@@ -267,7 +269,9 @@ public:
void print(llvm::raw_ostream& os) const;
const FieldDecl* getDecl() const { return cast<FieldDecl>(D); }
- QualType getType(ASTContext&) const { return getDecl()->getType(); }
+ QualType getType(ASTContext& C) const {
+ return C.getCanonicalType(getDecl()->getType());
+ }
static void ProfileRegion(llvm::FoldingSetNodeID& ID, FieldDecl* FD,
const MemRegion* superRegion) {
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index ae0383d06e..6a65919b1e 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -379,7 +379,7 @@ Store RegionStoreManager::InitializeArrayToUndefined(Store store, QualType T,
Store RegionStoreManager::InitializeStructToUndefined(Store store, QualType T,
MemRegion* BaseR) {
- QualType CT = T->getCanonicalTypeInternal();
+ QualType CT = StateMgr.getContext().getCanonicalType(T);
const RecordType* RT = cast<RecordType>(CT.getTypePtr());
RecordDecl* RD = RT->getDecl();
assert(RD->isDefinition());