[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 06:16:23 PST 2019


baloghadamsoftware created this revision.
baloghadamsoftware added reviewers: NoQ, Szelethus.
baloghadamsoftware added a project: clang.
Herald added subscribers: Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity, mgorny.
baloghadamsoftware added a parent revision: D70320: [Analyzer] [NFC] Iterator Checkers - Separate iterator modeling and the actual checkers.

STL Algorithms are usually implemented in a tricky for performance reasons which is too complicated for the analyzer. Furthermore inlining them is costly. Instead of inlining we should model their behavior according to the specifications.

This patch is the first step towards STL Algorithm modeling. It models all the `find()`-like functions in a simple way: the result is either found or not. In the future it can be extended to only return success if container modeling is also extended in a way the it keeps track of trivial insertions and deletions.


Repository:
  rC Clang

https://reviews.llvm.org/D70818

Files:
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
  clang/lib/StaticAnalyzer/Checkers/Iterator.cpp
  clang/lib/StaticAnalyzer/Checkers/Iterator.h
  clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp
  clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp
  clang/test/Analysis/Inputs/system-header-simulator-cxx.h
  clang/test/Analysis/stl-algorithm-modeling.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70818.231421.patch
Type: text/x-patch
Size: 42550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191128/ab869b1d/attachment-0001.bin>


More information about the cfe-commits mailing list