Add a QualType to ConjuredSymbol to represent the type and size of the symbol.
Use this updated interface when invalidating arguments passed by reference; the type of symbol is of the object passed by reference, not the reference itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56894 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index adbeff9..733cad1 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1515,7 +1515,9 @@
// Set the value of the variable to be a conjured symbol.
unsigned Count = Builder.getCurrentBlockCount();
- SymbolID NewSym = Eng.getSymbolManager().getConjuredSymbol(*I, Count);
+ SymbolID NewSym =
+ Eng.getSymbolManager().getConjuredSymbol(*I, DV->getDecl()->getType(),
+ Count);
state = state.SetRVal(*DV,
LVal::IsLValType(DV->getDecl()->getType())
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 40c2b65..41bf989 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1702,10 +1702,12 @@
break;
case UnaryOperator::Not:
+ // FIXME: Do we need to handle promotions?
St = SetRVal(St, U, EvalComplement(cast<NonLVal>(V)));
break;
case UnaryOperator::Minus:
+ // FIXME: Do we need to handle promotions?
St = SetRVal(St, U, EvalMinus(U, cast<NonLVal>(V)));
break;
diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp
index beb4379..24d2ed7 100644
--- a/lib/Analysis/SymbolManager.cpp
+++ b/lib/Analysis/SymbolManager.cpp
@@ -73,10 +73,10 @@
return SymbolCounter++;
}
-SymbolID SymbolManager::getConjuredSymbol(Expr* E, unsigned Count) {
+SymbolID SymbolManager::getConjuredSymbol(Expr* E, QualType T, unsigned Count) {
llvm::FoldingSetNodeID profile;
- SymbolConjured::Profile(profile, E, Count);
+ SymbolConjured::Profile(profile, E, T, Count);
void* InsertPos;
SymbolData* SD = DataSet.FindNodeOrInsertPos(profile, InsertPos);
@@ -85,7 +85,7 @@
return SD->getSymbol();
SD = (SymbolData*) BPAlloc.Allocate<SymbolConjured>();
- new (SD) SymbolConjured(SymbolCounter, E, Count);
+ new (SD) SymbolConjured(SymbolCounter, E, T, Count);
DataSet.InsertNode(SD, InsertPos);
DataMap[SymbolCounter] = SD;
@@ -118,7 +118,7 @@
}
case ConjuredKind:
- return cast<SymbolConjured>(this)->getExpr()->getType();
+ return cast<SymbolConjured>(this)->getType();
}
}