Create a symbolic region instead of a loc::SymbolVal. This is a continued step
to eliminate the use of loc::SymbolVal. llvm-svn: 68685
This commit is contained in:
		
							parent
							
								
									fc8b2b9ff9
								
							
						
					
					
						commit
						cb5d3ced70
					
				| 
						 | 
				
			
			@ -76,8 +76,8 @@ public:
 | 
			
		|||
  static SVal GetRValueSymbolVal(SymbolManager& SymMgr, MemRegionManager& MRMgr,
 | 
			
		||||
                                 const MemRegion* R);
 | 
			
		||||
 | 
			
		||||
  static SVal GetConjuredSymbolVal(SymbolManager& SymMgr, const Expr *E,
 | 
			
		||||
                                   unsigned Count);  
 | 
			
		||||
  static SVal GetConjuredSymbolVal(SymbolManager& SymMgr, MemRegionManager&,
 | 
			
		||||
                                   const Expr *E, unsigned Count);  
 | 
			
		||||
 | 
			
		||||
  inline bool isUnknown() const {
 | 
			
		||||
    return getRawKind() == UnknownKind;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2536,7 +2536,8 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
 | 
			
		|||
      
 | 
			
		||||
      // Conjure a new symbol if necessary to recover precision.
 | 
			
		||||
      if (Result.isUnknown() || !getConstraintManager().canReasonAbout(Result))
 | 
			
		||||
        Result = SVal::GetConjuredSymbolVal(SymMgr, Ex,
 | 
			
		||||
        Result = SVal::GetConjuredSymbolVal(SymMgr, 
 | 
			
		||||
                                       getStoreManager().getRegionManager(),Ex,
 | 
			
		||||
                                            Builder->getCurrentBlockCount());
 | 
			
		||||
      
 | 
			
		||||
      state = BindExpr(state, U, U->isPostfix() ? V2 : Result);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -291,26 +291,23 @@ SVal SVal::GetRValueSymbolVal(SymbolManager& SymMgr, MemRegionManager& MRMgr,
 | 
			
		|||
      return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
 | 
			
		||||
  
 | 
			
		||||
    // Only handle integers for now.
 | 
			
		||||
    if (T->isIntegerType())
 | 
			
		||||
    if (T->isIntegerType() && T->isScalarType())
 | 
			
		||||
      return NonLoc::MakeVal(sym);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return UnknownVal();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, const Expr* E,
 | 
			
		||||
                                unsigned Count) {
 | 
			
		||||
 | 
			
		||||
SVal SVal::GetConjuredSymbolVal(SymbolManager &SymMgr, MemRegionManager& MRMgr,
 | 
			
		||||
                                const Expr* E, unsigned Count) {
 | 
			
		||||
  QualType T = E->getType();
 | 
			
		||||
  SymbolRef sym = SymMgr.getConjuredSymbol(E, Count);
 | 
			
		||||
 | 
			
		||||
  if (Loc::IsLocType(T)) {
 | 
			
		||||
    SymbolRef Sym = SymMgr.getConjuredSymbol(E, Count);        
 | 
			
		||||
    return loc::SymbolVal(Sym);
 | 
			
		||||
  }
 | 
			
		||||
  else if (T->isIntegerType() && T->isScalarType()) {
 | 
			
		||||
    SymbolRef Sym = SymMgr.getConjuredSymbol(E, Count);        
 | 
			
		||||
    return nonloc::SymbolVal(Sym);                    
 | 
			
		||||
  }
 | 
			
		||||
  if (Loc::IsLocType(T))
 | 
			
		||||
    return Loc::MakeVal(MRMgr.getSymbolicRegion(sym));
 | 
			
		||||
 | 
			
		||||
  if (T->isIntegerType() && T->isScalarType())
 | 
			
		||||
    return NonLoc::MakeVal(sym);
 | 
			
		||||
 | 
			
		||||
  return UnknownVal();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue