[PATCH] D79425: [analyzer] StdLibraryFunctionsChecker: Add overload for adding the same summary for different names

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 02:04:36 PDT 2020


martong marked 2 inline comments as done.
martong added a comment.

In D79425#2022245 <https://reviews.llvm.org/D79425#2022245>, @xazax.hun wrote:

> I'd prefer to have this functionality committed together its first actual use with tests.


Okay, at the current state we add a summary individually for each name, that makes it easier to modify a summary for each function without effecting other functions.

> I also agree with @balazske, we should diagnose the cases when we have multiple summaries for the same function.

We already handle these cases with an assertion:

  auto Res = Map.insert({FD->getCanonicalDecl(), S});
  assert(Res.second && "Function already has a summary set!");
  (void)Res;





================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:672
+        operator()(Name, S);
+    }
   } addToFunctionSummaryMap(ACtx, FunctionSummaryMap);
----------------
balazske wrote:
> Theoretically it is possible to have a //multiple names//-//multiple summaries// case (multiple function names that have the same overloads)?
I think yes, that would be possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79425





More information about the cfe-commits mailing list