This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Simplify functions SVal::getAsSymbolicExpression and similar ones
ClosedPublic

Authored by ASDenysPetrov on Jul 31 2020, 9:10 AM.

Details

Summary

Simplify functions SVal::getAsSymbolicExpression, SVal::getAsSymExpr and SVal::getAsSymbol. After revision I concluded that getAsSymbolicExpression and getAsSymExpr repeat functionality of getAsSymbol, thus they can be removed.

Fix: Remove functions SVal::getAsSymbolicExpression and SVal::getAsSymExpr.

Diff Detail

Event Timeline

ASDenysPetrov created this revision.Jul 31 2020, 9:10 AM
ASDenysPetrov requested review of this revision.Jul 31 2020, 9:10 AM
ASDenysPetrov edited the summary of this revision. (Show Details)

Thanks for working on improving the quality of the codebase!
I again have to nitpick about the commit message, can you please change it to "Simplify ..."?

clang/lib/StaticAnalyzer/Core/SVals.cpp
135–149

Oof, it's a mess!

steakhal resigned from this revision.Jul 31 2020, 10:59 AM

It would be great to simplify these. I have also wondered once why those different functions exist.
Does anyone know what was the original intention of these functions?
Since I'm not confident in this area, I resign.

NoQ accepted this revision.Jul 31 2020, 5:10 PM

*standing ovation*

This was long overdue, thank you!

This revision is now accepted and ready to land.Jul 31 2020, 5:10 PM
ASDenysPetrov retitled this revision from [analyzer] Simplified functions SVal::getAsSymbolicExpression and similar ones to [analyzer] Simplify functions SVal::getAsSymbolicExpression and similar ones.Aug 2 2020, 4:10 PM
ASDenysPetrov added a comment.EditedAug 2 2020, 4:12 PM

@vsavchenko

I again have to nitpick about the commit message, can you please change it to "Simplify ..."?

Ready! Sorry, I remember, you've already told me.

Thanks all for review!

ASDenysPetrov edited the summary of this revision. (Show Details)Aug 2 2020, 4:13 PM
This revision was landed with ongoing or failed builds.Aug 3 2020, 5:03 AM
This revision was automatically updated to reflect the committed changes.

Ready! Sorry, I remember, you've already told me.

Nothing to be sorry about! It's really not that big of a deal. Thanks again!