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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66092 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp
index 45e1aae..589178f 100644
--- a/lib/Analysis/SymbolManager.cpp
+++ b/lib/Analysis/SymbolManager.cpp
@@ -52,10 +52,11 @@
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 @@
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;