Add an optional "tag" to conjured symbols that allows us to distinguish between

multiple symbols conjured at the same location. All that is required of the tag
is that it is a fixed void* value that points to an memory address that remains
valid throughout the remainder of the lifetime of the SymbolManager.

llvm-svn: 66092
This commit is contained in:
Ted Kremenek
2009-03-04 22:53:46 +00:00
parent 2d33d6300c
commit 6ee8f8bcb5
2 changed files with 24 additions and 15 deletions

View File

@@ -52,10 +52,11 @@ SymbolRef SymbolManager::getRegionRValueSymbol(const MemRegion* R) {
return SymbolCounter++;
}
SymbolRef SymbolManager::getConjuredSymbol(Stmt* E, QualType T, unsigned Count){
SymbolRef SymbolManager::getConjuredSymbol(Stmt* E, QualType T, unsigned Count,
const void* SymbolTag) {
llvm::FoldingSetNodeID profile;
SymbolConjured::Profile(profile, E, T, Count);
SymbolConjured::Profile(profile, E, T, Count, SymbolTag);
void* InsertPos;
SymbolData* SD = DataSet.FindNodeOrInsertPos(profile, InsertPos);
@@ -64,7 +65,7 @@ SymbolRef SymbolManager::getConjuredSymbol(Stmt* E, QualType T, unsigned Count){
return SD->getSymbol();
SD = (SymbolData*) BPAlloc.Allocate<SymbolConjured>();
new (SD) SymbolConjured(SymbolCounter, E, T, Count);
new (SD) SymbolConjured(SymbolCounter, E, T, Count, SymbolTag);
DataSet.InsertNode(SD, InsertPos);
DataMap[SymbolCounter] = SD;