[PATCH] D70878: [analyzer] Add support for namespaces to GenericTaintChecker

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 11 14:21:19 PST 2019


NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Looks great but i keep worrying that you're re-inventing `CallDescription` which already supports this feature (and many more) and we really need a single implementation of this logic because it has been historically very annoying and bugprone. Like, if you can convert your configs to a `CallDescriptionMap<>` while loading that'd be awesome.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp:396-407
+template <typename T>
+auto GenericTaintChecker::findFunctionInConfig(const ConfigDataMap<T> &Map,
+                                               const FunctionData &FData) {
+  auto Range = Map.equal_range(FData.Name);
+  auto It =
+      std::find_if(Range.first, Range.second, [&FData](const auto &Entry) {
+        const auto &Value = Entry.second;
----------------
👏 `Call` 👏 `Description` 👏 `Map` 👏


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70878/new/

https://reviews.llvm.org/D70878





More information about the cfe-commits mailing list