// Set the value of the variable to be a conjured symbol.
unsigned Count = Builder.getCurrentBlockCount();
QualType T = R->getType();
- SymbolID NewSym =
- Eng.getSymbolManager().getConjuredSymbol(*I, T, Count);
- state = state.SetSVal(*MR,
- Loc::IsLocType(T)
- ? cast<SVal>(loc::SymbolVal(NewSym))
- : cast<SVal>(nonloc::SymbolVal(NewSym)));
+ // FIXME: handle structs.
+ if (T->isIntegerType() || Loc::IsLocType(T)) {
+ SymbolID NewSym =
+ Eng.getSymbolManager().getConjuredSymbol(*I, T, Count);
+
+ state = state.SetSVal(*MR,
+ Loc::IsLocType(T)
+ ? cast<SVal>(loc::SymbolVal(NewSym))
+ : cast<SVal>(nonloc::SymbolVal(NewSym)));
+ }
+ else {
+ state = state.SetSVal(*MR, UnknownVal());
+ }
}
else
state = state.SetSVal(*MR, UnknownVal());
default:
assert (false && "Unhandled RetEffect."); break;
- case RetEffect::NoRet:
+ case RetEffect::NoRet: {
// Make up a symbol for the return value (not reference counted).
// FIXME: This is basically copy-and-paste from GRSimpleVals. We
// should compose behavior, not copy it.
- if (Ex->getType() != Eng.getContext().VoidTy) {
+ // FIXME: We eventually should handle structs and other compound types
+ // that are returned by value.
+
+ QualType T = Ex->getType();
+
+ if (T->isIntegerType() || Loc::IsLocType(T)) {
unsigned Count = Builder.getCurrentBlockCount();
SymbolID Sym = Eng.getSymbolManager().getConjuredSymbol(Ex, Count);
}
break;
+ }
case RetEffect::Alias: {
unsigned idx = RE.getIndex();
case BinaryOperator::Assign: {
// EXPERIMENTAL: "Conjured" symbols.
+ // FIXME: Handle structs.
+ QualType T = RHS->getType();
- if (RightV.isUnknown()) {
+ if (RightV.isUnknown() && (T->isIntegerType() || Loc::IsLocType(T))) {
unsigned Count = Builder->getCurrentBlockCount();
SymbolID Sym = SymMgr.getConjuredSymbol(B->getRHS(), Count);
}
- // Make up a symbol for the return value of this function.
-
- if (CE->getType() != Eng.getContext().VoidTy) {
+ // Make up a symbol for the return value of this function.
+ // FIXME: We eventually should handle structs and other compound types
+ // that are returned by value.
+ QualType T = CE->getType();
+ if (T->isIntegerType() || Loc::IsLocType(T)) {
unsigned Count = Builder.getCurrentBlockCount();
SymbolID Sym = Eng.getSymbolManager().getConjuredSymbol(CE, Count);