class SymbolConjured : public SymbolData {
Expr* E;
+ QualType T;
unsigned Count;
public:
- SymbolConjured(SymbolID Sym, Expr* exp, unsigned count)
- : SymbolData(ConjuredKind, Sym), E(exp), Count(count) {}
+ SymbolConjured(SymbolID Sym, Expr* exp, QualType t, unsigned count)
+ : SymbolData(ConjuredKind, Sym), E(exp), T(t), Count(count) {}
Expr* getExpr() const { return E; }
unsigned getCount() const { return Count; }
+ QualType getType() const { return T; }
+
static void Profile(llvm::FoldingSetNodeID& profile,
- Expr* E, unsigned Count) {
+ Expr* E, QualType T, unsigned Count) {
profile.AddInteger((unsigned) ConjuredKind);
profile.AddPointer(E);
+ profile.Add(T);
profile.AddInteger(Count);
}
virtual void Profile(llvm::FoldingSetNodeID& profile) {
- Profile(profile, E, Count);
+ Profile(profile, E, T, Count);
}
// Implement isa<T> support.
SymbolID getSymbol(VarDecl* D);
SymbolID getContentsOfSymbol(SymbolID sym);
- SymbolID getConjuredSymbol(Expr* E, unsigned VisitCount);
+ SymbolID getConjuredSymbol(Expr* E, QualType T, unsigned VisitCount);
+ SymbolID getConjuredSymbol(Expr* E, unsigned VisitCount) {
+ return getConjuredSymbol(E, E->getType(), VisitCount);
+ }
const SymbolData& getSymbolData(SymbolID ID) const;
// 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())
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;
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);
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;
}
case ConjuredKind:
- return cast<SymbolConjured>(this)->getExpr()->getType();
+ return cast<SymbolConjured>(this)->getType();
}
}