[PATCH] D13336: [MSVC] 'property' with an empty array in array subscript expression.

John McCall via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 16:14:31 PST 2015


rjmccall added inline comments.

================
Comment at: lib/Sema/SemaPseudoObject.cpp:57
@@ +56,3 @@
+      // with a base limits the number of cases here.
+      assert(refExpr->isObjectReceiver());
+
----------------
Well, it should be okay to call this on something that doesn't have a base; it just doesn't need to do anything and can just return refExpr.

================
Comment at: lib/Sema/SemaPseudoObject.cpp:1591
@@ +1590,3 @@
+      return baseOVE->getSourceExpr();
+    } else if (ObjCSubscriptRefExpr *refExpr =
+                   dyn_cast<ObjCSubscriptRefExpr>(opaqueRef)) {
----------------
That's what I'm saying, though: the capture process should be building the syntactic MSPropertySubscriptExpr using the captured OVEs for the index expressions as well as the recursively-captured base, and Rebuilder will then need to undo that.

We want to consistently replace all the captured sub-trees with their OVEs so that clients can easily recover the relationship between the syntactic and semantic forms.

================
Comment at: lib/Sema/SemaPseudoObject.cpp:1621
@@ -1582,1 +1620,3 @@
+  };
+  return Rebuilder(S, Callback).rebuild(E);
 }
----------------
My hope is that you'll be able to get this whole function down to just this last line and won't need to split out any of the cases here.


http://reviews.llvm.org/D13336





More information about the cfe-commits mailing list