[cfe-commits] r108157 - in /cfe/trunk: include/clang/AST/Expr.h lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Mon Jul 12 10:32:46 PDT 2010


On Jul 12, 2010, at 10:26 AM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Mon Jul 12 12:26:57 2010
> New Revision: 108157
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=108157&view=rev
> Log:
> Move setting of Dependent Type to BlockDeclRefExpr's
> constructor.
> 
> Modified:
>    cfe/trunk/include/clang/AST/Expr.h
>    cfe/trunk/lib/Sema/SemaExpr.cpp
> 
> Modified: cfe/trunk/include/clang/AST/Expr.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=108157&r1=108156&r2=108157&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/AST/Expr.h (original)
> +++ cfe/trunk/include/clang/AST/Expr.h Mon Jul 12 12:26:57 2010
> @@ -3398,8 +3398,10 @@
>   // FIXME: Fix type/value dependence!
>   BlockDeclRefExpr(ValueDecl *d, QualType t, SourceLocation l, bool ByRef,
>                    bool constAdded = false,
> -                   Stmt *copyConstructorVal = 0)
> -  : Expr(BlockDeclRefExprClass, t, false, false), D(d), Loc(l), IsByRef(ByRef),
> +                   Stmt *copyConstructorVal = 0,
> +                   bool hasDependentType = false)
> +  : Expr(BlockDeclRefExprClass, t, hasDependentType, false), 
> +    D(d), Loc(l), IsByRef(ByRef),
>     ConstQualAdded(constAdded),  CopyConstructorVal(copyConstructorVal) {}

Thanks, Fariborz! I don't think we even need a parameter for hasDependentType. Why not just check

	!t.isNull() && t.isDependentType()?

The isDependentType() check is very fast; basically just looking at a bit in the canonical Type structure.

	- Doug



More information about the cfe-commits mailing list