[PATCH] D45410: [Sema] Remove dead code in BuildAnonymousStructUnionMemberReference. NFCI

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 7 20:37:10 PDT 2018


EricWF created this revision.
EricWF added reviewers: rsmith, aaron.ballman, majnemer, rjmccall.

This patch cleans up a bunch of dead or unused code in BuildAnonymousStructUnionMemberReference.

The dead code was a branch that built a new CXXThisExpr when we weren't given a base object expression or base variable.
However, BuildAnonymousFoo has only two callers. One of which always builds a base object expression first, the second only calls when the IndirectFieldDecl is not a C++ class member. Even within C this branch seems entirely unused.

I tried diligently to write a test which hit it with no success.

This patch removes the branch and replaces it with an assertion that we were given either a base object expression or a base variable.


Repository:
  rC Clang

https://reviews.llvm.org/D45410

Files:
  lib/Sema/SemaExprMember.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45410.141516.patch
Type: text/x-patch
Size: 4235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180408/7cc66ab7/attachment-0001.bin>


More information about the cfe-commits mailing list