This is an archive of the discontinued LLVM Phabricator instance.

Refactor: Simplify boolean conditional return statements in lib/AST
AbandonedPublic

Authored by LegalizeAdulthood on May 25 2015, 12:50 PM.

Details

Summary

Use clang-tidy to simplify boolean conditional return statements

Diff Detail

Event Timeline

LegalizeAdulthood retitled this revision from to Refactor: Simplify boolean conditional return statements in lib/AST.
LegalizeAdulthood updated this object.
LegalizeAdulthood edited the test plan for this revision. (Show Details)
LegalizeAdulthood added a subscriber: Unknown Object (MLST).
dblaikie added inline comments.
lib/AST/ASTImporter.cpp
401 ↗(On Diff #26487)

Isn't this the sort of chained conditional you/we decided not to flag/suggest changes on?

lib/AST/Decl.cpp
2380

this should probably be:

if (auto *CS = dyn_cast<CompoundStmt>(S))
  return CS->body_empty();
return false;
lib/AST/DeclBase.cpp
305 ↗(On Diff #26487)

another possible 'chain' style return

lib/AST/DeclCXX.cpp
409

Another chain return

lib/AST/Expr.cpp
2677

Possible chain

lib/AST/ExprConstant.cpp
225

possible chain

2274

possible chain

lib/AST/ItaniumMangle.cpp
1869 ↗(On Diff #26487)

chain

3728 ↗(On Diff #26487)

chain

Update from latest.
I do not have commit access.

LegalizeAdulthood abandoned this revision.Feb 19 2016, 9:20 AM