[PATCH] D111639: [Sema] check PseudoObject when rebuilding CXXOperatorCallExpr in template instantiation

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 15 12:35:24 PDT 2021


rnk added a subscriber: rjmccall.
rnk added a comment.

So, after reading through Build(Unary|Bin)Op, I think the duplication of logic between TreeTransform is intentional, and the better fix is to generalize the existing logic for placeholder handling. If you enter into the Build*Op codepaths, you will re-run a lot of redundant checks. Maybe + at rjmccall can provide a second opinion.



================
Comment at: clang/lib/Sema/TreeTransform.h:14572
 
   if (First->getObjectKind() == OK_ObjCProperty) {
     BinaryOperatorKind Opc = BinaryOperator::getOverloadedOpcode(Op);
----------------
I notice that ObjC pseudo objects are handled here. Is there a way to unify things? Can this code be removed if we route builtin operators over to `Sema::Build(Bin|Unary)Op`?


================
Comment at: clang/lib/Sema/TreeTransform.h:14583
 
   if (Second && Second->getObjectKind() == OK_ObjCProperty) {
     ExprResult Result = SemaRef.CheckPlaceholderExpr(Second);
----------------
This is also pseudo object handling code


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111639/new/

https://reviews.llvm.org/D111639



More information about the cfe-commits mailing list