This is an archive of the discontinued LLVM Phabricator instance.

[Sema][NFC] Small cleanup - remove dead code from ActOnCallExpr() ?
AbandonedPublic

Authored by jkorous on Aug 30 2018, 7:59 AM.

Details

Summary

Since there's no change to ArgExprs between here and the previous early exit starting at L 5333 it's effectively a dead code.

On the other hand a possible counter-argument is that code gets a bit more brittle.

WDYT?

Diff Detail

Repository
rC Clang

Event Timeline

jkorous created this revision.Aug 30 2018, 7:59 AM
JDevlieghere accepted this revision.Aug 30 2018, 8:47 AM

Assuming ArgExprs doesn't change between those two calls this seems fine.

Sema/SemaExpr.cpp
5338

While you're at it you might as well remove the else branch here.

This revision is now accepted and ready to land.Aug 30 2018, 8:47 AM

Sorry for the delay - I was busy with other things for past two weeks.

Sema/SemaExpr.cpp
5338

Sorry, I am not following. Do you mean just refactoring?

if a
  foo
else
  bar

->

if a
  foo

bar

Or do you really mean removing the else branch? I don't see how that would be NFC.

JDevlieghere added inline comments.Sep 10 2018, 7:48 AM
Sema/SemaExpr.cpp
5338

Yup, that's what I meant. since we have a return anyway.

I got some test failure with the patch, still investigating the issue.

jkorous abandoned this revision.Jan 21 2022, 3:50 PM