This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][NFC] CallDescription should own the qualified name parts
ClosedPublic

Authored by steakhal on Nov 10 2021, 10:46 AM.

Details

Summary

Previously, CallDescription simply referred to the qualified name parts
by const char* pointers.
In the future, we might want to dynamically load and populate
CallDescriptionMaps, hence we will need the CallDescriptions to
actually own their qualified name parts.

Diff Detail

Event Timeline

steakhal created this revision.Nov 10 2021, 10:46 AM
xazax.hun accepted this revision.Nov 12 2021, 9:26 AM
This revision is now accepted and ready to land.Nov 12 2021, 9:26 AM
NoQ added a comment.Nov 16 2021, 6:11 PM

Why though? Are you actually putting anything in there that isn't a static string literal?

Why though? Are you actually putting anything in there that isn't a static string literal?

If we plan in the future to dynamically populate CallDescriptionMaps then we will need owning semantics for CallDescriptions actually owning the qualified name parts.
Consider the GenericTaintChecker, which currently implements an ad-hoc function call matching just because of this.
Ideally, what we want is just parsing the config and populating the corresponding maps.
On the other hand, it could come in handy in the StdLibraryChecker as well, if we decide to hoist the DSL and let users specify their API in config files in a similar manner.

martong accepted this revision.Nov 18 2021, 9:25 AM

LGTM!

This revision was landed with ongoing or failed builds.Nov 19 2021, 9:33 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 9:33 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript