Page MenuHomePhabricator

[analyzer] Introduce clang_analyzer_dumpSvalType introspection function
ClosedPublic

Authored by steakhal on May 13 2022, 3:39 AM.

Details

Summary

In some rare cases the type of an SVal might be interesting.
This introspection function exposes this information in tests.

Diff Detail

Event Timeline

steakhal created this revision.May 13 2022, 3:39 AM
Herald added a project: Restricted Project. · View Herald Transcript
steakhal requested review of this revision.May 13 2022, 3:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 3:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
martong accepted this revision.May 13 2022, 5:44 AM
martong added inline comments.
clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
268

Would it make sense to call Ty->dump(OS) to a stream and then report the string of the stream?
That way we could see some more information. Or perhaps that could be done in another introspection function.

This revision is now accepted and ready to land.May 13 2022, 5:44 AM
steakhal marked an inline comment as done.May 13 2022, 7:31 AM
steakhal added inline comments.
clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
268

It's way harder to match on such dumps. Those contain pointer addresses all over the place, making FileChecking a nightmare.

This revision was automatically updated to reflect the committed changes.
steakhal marked an inline comment as done.