This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Support integral casts
ClosedPublic

Authored by ymandel on Apr 4 2022, 8:33 AM.

Details

Summary

Adds support for implicit casts CK_IntegralCast and CK_IntegralToBoolean.

Diff Detail

Event Timeline

ymandel created this revision.Apr 4 2022, 8:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 8:33 AM
ymandel requested review of this revision.Apr 4 2022, 8:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 8:33 AM
ymandel updated this revision to Diff 420196.Apr 4 2022, 8:36 AM

fix typo

xazax.hun accepted this revision.Apr 4 2022, 3:06 PM
This revision is now accepted and ready to land.Apr 4 2022, 3:06 PM
sgatev accepted this revision.Apr 5 2022, 1:28 AM
sgatev added inline comments.
clang/lib/Analysis/FlowSensitive/Transfer.cpp
206

Nit: Just Loc? I believe that's what we use in other places in this file if it's a location for S.

clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
1904

Why not assert the type of the value in this test and in IntegralCast below?

ymandel updated this revision to Diff 420483.Apr 5 2022, 6:17 AM
ymandel marked an inline comment as done.

address comments

ymandel marked an inline comment as done.Apr 5 2022, 6:19 AM
ymandel added inline comments.
clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
1904

Sure, but went with an ASSERT, since it gives better error messages when it fails (rather than cast, which will crash the test).

This revision was landed with ongoing or failed builds.Apr 5 2022, 6:56 AM
This revision was automatically updated to reflect the committed changes.