[all-commits] [llvm/llvm-project] 60bad9: [Analyzer] Iterator Modeling - Model `std::advance...

Balogh, Ádám via All-commits all-commits at lists.llvm.org
Mon Mar 23 07:30:02 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 60bad941a1c1b745f570da8251f2ba9ee8b7d06e
      https://github.com/llvm/llvm-project/commit/60bad941a1c1b745f570da8251f2ba9ee8b7d06e
  Author: Adam Balogh <adam.balogh at ericsson.com>
  Date:   2020-03-23 (Mon, 23 Mar 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp
    M clang/test/Analysis/Inputs/system-header-simulator-cxx.h
    M clang/test/Analysis/iterator-modelling.cpp

  Log Message:
  -----------
  [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

Whenever the analyzer budget runs out just at the point where
`std::advance()`, `std::prev()` or `std::next()` is invoked the function
are not inlined. This results in strange behavior such as
`std::prev(v.end())` equals `v.end()`. To prevent this model these
functions if they were not inlined. It may also happend that although
`std::advance()` is inlined but a function it calls inside (e.g.
`__advance()` in some implementations) is not. This case is also handled
in this patch.

Differential Revision: https://reviews.llvm.org/D76361




More information about the All-commits mailing list