<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, 20 Jul 2018 at 18:21, George Karpenkov via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have stumbled into this curios pattern today: ObjCIvarRefExpr is *not* a subclass of DeclRefExpr.<br>
Does anyone know why is this the case? Anyone against changing this?<br></blockquote><div><br></div><div>ObjCIvarRefExpr should not be a subclass of DeclRefExpr. DeclRefExpr is used to represent cases where a declaration is named directly; ObjCIvarRefExpr, like MemberExpr, is used to represent naming a decaration as a member / ivar of another object. </div><div><br></div><div>Perhaps ObjCIvarRefExpr and MemberExpr should have a comnon base class, for member-access-like things, but I can't recall off-hand any places where that'd really save us much. And you could perhaps make a case that the "member name" portion of a MemberExpr or ObjCIvarRefExpr should be a DeclRefExpr, but at this point that would be a lot of churn for little benefit.<br></div></div></div>