diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-19 06:00:32 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-06-19 06:00:32 +0000 |
commit | 54fb536b5c191317a4544e26964189a67a09cdcf (patch) | |
tree | 07a9297354fa14f4fcd3bf810873e6ed2a7c0fe1 /clang/lib/Analysis/SymbolManager.cpp | |
parent | 77585a24ac481c5773d96f561840b04e81b22161 (diff) | |
download | bcm5719-llvm-54fb536b5c191317a4544e26964189a67a09cdcf.tar.gz bcm5719-llvm-54fb536b5c191317a4544e26964189a67a09cdcf.zip |
A further step of r73690: associate the cast-to type with the created symbol,
because the type of the symbol is used to create the default range. We need the
sign to be consistent.
llvm-svn: 73756
Diffstat (limited to 'clang/lib/Analysis/SymbolManager.cpp')
-rw-r--r-- | clang/lib/Analysis/SymbolManager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Analysis/SymbolManager.cpp b/clang/lib/Analysis/SymbolManager.cpp index 5c885cd6e15..4e38a3492c7 100644 --- a/clang/lib/Analysis/SymbolManager.cpp +++ b/clang/lib/Analysis/SymbolManager.cpp @@ -92,14 +92,14 @@ std::ostream& std::operator<<(std::ostream& os, const SymExpr *SE) { } const SymbolRegionValue* -SymbolManager::getRegionValueSymbol(const MemRegion* R) { +SymbolManager::getRegionValueSymbol(const MemRegion* R, QualType T) { llvm::FoldingSetNodeID profile; - SymbolRegionValue::Profile(profile, R); + SymbolRegionValue::Profile(profile, R, T); void* InsertPos; SymExpr *SD = DataSet.FindNodeOrInsertPos(profile, InsertPos); if (!SD) { SD = (SymExpr*) BPAlloc.Allocate<SymbolRegionValue>(); - new (SD) SymbolRegionValue(SymbolCounter, R); + new (SD) SymbolRegionValue(SymbolCounter, R, T); DataSet.InsertNode(SD, InsertPos); ++SymbolCounter; } @@ -166,6 +166,9 @@ QualType SymbolConjured::getType(ASTContext&) const { } QualType SymbolRegionValue::getType(ASTContext& C) const { + if (!T.isNull()) + return T; + if (const TypedRegion* TR = dyn_cast<TypedRegion>(R)) return TR->getValueType(C); |