[cfe-commits] r57657 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRExprEngine.h include/clang/Analysis/PathSensitive/GRState.h include/clang/Analysis/PathSensitive/RValues.h include/clang/Analysis/PathSensitive/Store.h lib/Analysis/Basi

Ted Kremenek kremenek at apple.com
Sun Oct 19 21:03:49 PDT 2008


On Oct 19, 2008, at 6:37 AM, Zhongxing Xu wrote:

> -  // Get the lvalue of an expression.
> -  // FIXME: Remove this method, and implement specialized versions  
> for
> -  //  specific Decls.
> -  virtual RVal getLValue(const GRState* St, const Expr* Ex) = 0;
> +  virtual RVal getLValueVar(const GRState* St, const VarDecl* VD) =  
> 0;
>
> -  virtual RVal getLValue(const GRState* St, const ObjCIvarDecl* D,  
> RVal Base)=0;
> +  virtual RVal getLValueIvar(const GRState* St, const ObjCIvarDecl*  
> D,
> +                             RVal Base)=0;
> +
> +  virtual RVal getLValueField(const GRState* St, const FieldDecl* D,
> +                              RVal Base) = 0;
> +
> +  virtual RVal getLValueElement(const GRState* St, RVal Base, RVal  
> Offset) = 0;
>
> If we split getLValue() into these separate cases, is parameter  
> GRState* St still needed, as we have already passed in all we need  
> to build the lvalue?

I believe that the GRState* argument is still needed.  getLValueXXX  
could involve arbitrary querying of the store; there is no reason to  
limited its implementation based on what is passed in through the SVal  
arguments.  For example, we may need to lookup in the store the  
current region for a VarDecl.



More information about the cfe-commits mailing list