[PATCH] Sema for Captured Statements

Douglas Gregor dgregor at apple.com
Tue Mar 12 12:52:09 PDT 2013



Sent from my iPhone

On Mar 12, 2013, at 5:21 AM, Ben Langmuir <ben.langmuir at intel.com> wrote:

> 
>  Thanks for the review comments. Does the following division make sense to you?
> 
>  CapturedDecl: wraps DeclContext and contains Captures and body statement
>  CapturedStmt: Contains CapturedStmtDecl, and CaptureInits

Yes, that makes sense to me. 

> ================
> Comment at: lib/Sema/SemaExprCXX.cpp:739
> @@ +738,3 @@
> +
> +    if (CapturedRegionScopeInfo *RSI
> +        = dyn_cast<CapturedRegionScopeInfo>(FunctionScopes[idx])) {
> ----------------
> Doug Gregor wrote:
>> else if... ?
> Will do.
> 
> ================
> Comment at: lib/Sema/SemaExprCXX.cpp:740
> @@ +739,3 @@
> +    if (CapturedRegionScopeInfo *RSI
> +        = dyn_cast<CapturedRegionScopeInfo>(FunctionScopes[idx])) {
> +      RecordDecl *RD = RSI->TheRecordDecl;
> ----------------
> Doug Gregor wrote:
>> Please indent the '=' an extra two spaces.
> Will do.
> 
> ================
> Comment at: lib/Sema/SemaStmt.cpp:2312
> @@ -2307,1 +2311,3 @@
> +  }
> +
>   // For blocks/lambdas with implicit return types, we check each return
> ----------------
> Doug Gregor wrote:
>> There's an if-else chain below (~line 2352)  that checks block and lambda scopes. How about just extending those checks? HasImplicitReturnType will be false anyway.
> Makes sense.
> 
> ================
> Comment at: lib/Sema/SemaStmt.cpp:2868
> @@ +2867,3 @@
> +
> +  IdentifierInfo *Id = &PP.getIdentifierTable().get("capture");
> +  RecordDecl *RD = 0;
> ----------------
> Doug Gregor wrote:
>> Please make the generated struct anonymous. We want no chance of it showing up anywhere.
> Will do.
> 
> 
> http://llvm-reviews.chandlerc.com/D433



More information about the cfe-commits mailing list