This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][AnalysisOrder] Display the CallEvent type for preCall/postCall
ClosedPublic

Authored by Szelethus on Apr 3 2020, 6:33 AM.

Details

Summary

Exactly what it says on the tin! The included testfile demonstrates why this is important -- for C++ dynamic memory operators, we don't always recognize custom, or even standard-specified new/delete operators as CXXAllocatorCall or CXXDeallocatorCall.

Diff Detail

Event Timeline

Szelethus created this revision.Apr 3 2020, 6:33 AM
NoQ accepted this revision.Apr 6 2020, 11:54 AM

Wonderful tests!

clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
202

Maybe make a static StringRef getKindAsString(Kind); in the base class and defer to it instead so that they all were in one place near the enum itself?

(i'm not sure it's actually better)

clang/test/Analysis/Inputs/system-header-simulator-cxx.h
971–998

Does it need to be guarded with #if __cplusplus >= ... then?

This revision is now accepted and ready to land.Apr 6 2020, 11:54 AM
Szelethus marked an inline comment as done.Apr 9 2020, 7:24 AM
Szelethus added inline comments.
clang/test/Analysis/Inputs/system-header-simulator-cxx.h
971–998

It wasn't guarded before, so I don't think so?

Szelethus marked 2 inline comments as done.Apr 9 2020, 7:35 AM
Szelethus added inline comments.
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
202

Well, each of these kinds are tied to a CallEvent class, so this made sense when I wrote it. I think these approaches are equivalent, so I'll stick with this one if you don't mind :)

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