This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Generate readable form of boolean values for debugging purposes.
ClosedPublic

Authored by wyt on Jul 12 2022, 1:48 AM.

Details

Summary

debugString generates a s-expression string for a given boolean value B.
Atoms appearing in the boolean value B are labeled with a user-specified name in Names or given a default name in the form of B0, B1, ...

Depends On D129546

Diff Detail

Event Timeline

wyt created this revision.Jul 12 2022, 1:48 AM
Herald added a project: Restricted Project. · View Herald Transcript
wyt requested review of this revision.Jul 12 2022, 1:48 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 12 2022, 1:48 AM
wyt updated this revision to Diff 443868.Jul 12 2022, 2:01 AM

Update CMakeList for DebugSupportTest.cpp

wyt retitled this revision from [clang][dataflow] Generate readable form of boolean values. to [clang][dataflow] Generate readable form of boolean values for debugging purposes..Jul 12 2022, 2:26 AM
wyt edited the summary of this revision. (Show Details)
wyt updated this revision to Diff 443905.Jul 12 2022, 3:26 AM

Extract recursion into boolean subvalues into separate statements to enforce order of evaluation.

wyt updated this revision to Diff 443914.Jul 12 2022, 5:03 AM

Minor fixes.

wyt edited the summary of this revision. (Show Details)Jul 12 2022, 5:12 AM
gribozavr2 added inline comments.Jul 12 2022, 6:08 AM
clang/include/clang/Analysis/FlowSensitive/DebugSupport.h
25–26
36–37

Does a default argument work?

clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
31–40

To avoid even creating a set in the release mode.

33
47
clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp
22–33

It is usually better to avoid fixtures, to keep each test self-contained.

Please apply to the whole file.

31

This should be just B0 without parentheses.

40

Here we should also have B0 without parentheses. So (not B0).

Please apply everywhere in the file.

135

NamedBools seems to be not used?..

172

NamedBools seems to be not used?..

wyt updated this revision to Diff 443940.Jul 12 2022, 7:46 AM
wyt marked 10 inline comments as done.

Address comments.

wyt updated this revision to Diff 443968.Jul 12 2022, 8:50 AM

Fix use after move.

xazax.hun accepted this revision.Jul 12 2022, 8:55 AM
xazax.hun added inline comments.
clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
29

This class could be in anonymous namespace.

This revision is now accepted and ready to land.Jul 12 2022, 8:55 AM
wyt updated this revision to Diff 443982.Jul 12 2022, 9:12 AM

Move DebugStringGenerator class into anonymous namespace.

gribozavr2 accepted this revision.Jul 12 2022, 9:16 AM
gribozavr2 added inline comments.
clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
34–35
wyt updated this revision to Diff 444029.Jul 12 2022, 11:38 AM
wyt marked an inline comment as done.

Address comment on renaming parameter. Add const qualifier to BoolValue input to debugString.

wyt marked an inline comment as done.Jul 12 2022, 11:49 AM
This revision was landed with ongoing or failed builds.Jul 13 2022, 3:35 AM
This revision was automatically updated to reflect the committed changes.