[cfe-commits] Handle ExprWithCleanups when creating goto scopes

Douglas Gregor dgregor at apple.com
Fri Oct 26 10:18:15 PDT 2012


On Oct 24, 2012, at 2:11 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> A revised set of patches that keeps SubobjectAdjustment is attached.

First four patches look good, although we need some documentation on those helper functions.

The fifth patch is the interesting one. Just one comment here:

+      for (;;) {
+        const MaterializeTemporaryExpr *M = NULL;
+        Init = Init->findMaterializedTemporary(M);
 
-        if (inDiagToUse)
-          InDiag = inDiagToUse;
+        const ExprWithCleanups *EWC = dyn_cast<ExprWithCleanups>(Init);
+        if (!EWC)
+          break;
+        Init = EWC->getSubExpr();
+      }

The loop is unnecessary; there should only be one ExprWithCleanups at the top level.

Otherwise, LGTM. Thanks!

	- Doug

> Thanks,
> Rafael
> <0001-delay-codegen-by-not-putting-a-llvm-Value-in-Subobje.patch><0002-factor-code-into-skipRValueSubobjectAdjustments.patch><0003-factor-code-into-findMaterializedTemporary.patch><0004-move-helper-functions.patch><0005-fix-it.patch>





More information about the cfe-commits mailing list