This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer][solver][NFC] print constraints deterministically (ordered by their string representation)
ClosedPublic

Authored by martong on Jul 23 2021, 2:46 AM.

Details

Summary

This change is an extension to D103967 where I added dump methods for
(dis)equality classes of the State. There, the (dis)equality classes and their
contents are dumped in an ordered fashion, they are ordered based on their
string representation. This is very useful once we start to use FileCheck to
test the State dump in certain tests.

Diff Detail

Event Timeline

martong created this revision.Jul 23 2021, 2:46 AM
martong requested review of this revision.Jul 23 2021, 2:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2021, 2:46 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NoQ accepted this revision.Jul 23 2021, 8:40 AM

Thanks!

You got me thinking whether two symbols can have the same dump. We definitely don't want this to happen but there's also no reason to believe it doesn't, given that this wouldn't affect any actual behavior or any tests. Can we add an assert here that the symbol is always freshly added? In this case we'd at least know when that happens.

This revision is now accepted and ready to land.Jul 23 2021, 8:40 AM
This revision was landed with ongoing or failed builds.Jul 26 2021, 7:27 AM
This revision was automatically updated to reflect the committed changes.

Thanks!

You got me thinking whether two symbols can have the same dump. We definitely don't want this to happen but there's also no reason to believe it doesn't, given that this wouldn't affect any actual behavior or any tests. Can we add an assert here that the symbol is always freshly added? In this case we'd at least know when that happens.

Thanks for the review! I've added an assertion to check that a symbol's dump is unique.