[cfe-commits] r58247 - in /cfe/trunk: include/clang/Analysis/PathSensitive/MemRegion.h lib/Analysis/RegionStore.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Mon Oct 27 06:35:03 PDT 2008
Author: zhongxingxu
Date: Mon Oct 27 08:35:03 2008
New Revision: 58247
URL: http://llvm.org/viewvc/llvm-project?rev=58247&view=rev
Log:
Use ASTContext::getCanonicalType() to get TypedRegion's type.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
cfe/trunk/lib/Analysis/RegionStore.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h?rev=58247&r1=58246&r2=58247&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h Mon Oct 27 08:35:03 2008
@@ -154,8 +154,8 @@
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 @@
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 @@
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 @@
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) {
Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=58247&r1=58246&r2=58247&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Oct 27 08:35:03 2008
@@ -379,7 +379,7 @@
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());
More information about the cfe-commits
mailing list