Use ASTContext::getCanonicalType() to get TypedRegion's type.

llvm-svn: 58247
This commit is contained in:
Zhongxing Xu 2008-10-27 13:35:03 +00:00
parent 75cf2e03ab
commit 144d7554c4
2 changed files with 10 additions and 6 deletions

View File

@ -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) {

View File

@ -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());