[PATCH] D77229: [Analyzer][WIP] Avoid handling of LazyCompundVals in IteratorModeling

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 3 06:25:05 PDT 2020


baloghadamsoftware added a comment.

Output of

  /home/edmbalo/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/ssd/edmbalo/llvm-project/build/lib/clang/11.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -std=c++11 -analyzer-checker=core,cplusplus,debug.DebugIteratorModeling,debug.ExprInspection -analyzer-config aggressive-binary-operation-simplification=true -analyzer-config c++-container-inlining=false /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp

is the following:

  Container PostCall
  Original RetVal: lazyCompoundVal{0x55563691e490,i0}
    Retrieving Original
  Updated RetVal: &i0
  Generic PostCall
  Original RetVal: lazyCompoundVal{0x55563691e490,i0}
    Retrieving Original
  Updated RetVal: &i0
  Container PostCall
  Original RetVal: lazyCompoundVal{0x555636921ba0,temp_object{std::list<int>::const_iterator, S48444}}
    Retrieving Original
  Updated RetVal: &temp_object{std::list<int>::const_iterator, S48444}
  Generic PostCall
  Original RetVal: lazyCompoundVal{0x555636921ba0,temp_object{std::list<int>::const_iterator, S48444}}
    Retrieving Original
  Updated RetVal: &temp_object{std::list<int>::const_iterator, S48444}
  Container PostCall
  Original RetVal: lazyCompoundVal{0x555636922d28,i1}
      No Stack Frame!
    No construction context!!!
  Generic PostCall
  Original RetVal: lazyCompoundVal{0x555636922d28,i1}
      No Stack Frame!
    No construction context!!!
  Container PostCall
  Original RetVal: lazyCompoundVal{0x555636925348,i2}
    Retrieving Original
  Updated RetVal: &i2
  Generic PostCall
  Original RetVal: lazyCompoundVal{0x555636925348,i2}
    Retrieving Original
  Updated RetVal: &i2
  Container PostCall
  Original RetVal: conj_$3{long, LC1, S45775, #1}
  Updated RetVal: conj_$3{long, LC1, S45775, #1}
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: conj_$11{long, LC1, S48640, #1}
  Updated RetVal: conj_$11{long, LC1, S48640, #1}
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: 0 S64b
  Updated RetVal: 0 S64b
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Bind Old: lazyCompoundVal{0x555636925348,i1}
  Bind New: &temp_object{std::list<int>::const_iterator, S49796}
  Container PostCall
  Original RetVal: lazyCompoundVal{0x555636921918,temp_object{std::list<int>::const_iterator, S49796}}
    Retrieving Original
    Handling New
  Updated RetVal: &temp_object{std::list<int>::const_iterator, S49796}
  Generic PostCall
  Original RetVal: lazyCompoundVal{0x555636921918,temp_object{std::list<int>::const_iterator, S49796}}
    Retrieving Original
    Handling New
  Updated RetVal: &temp_object{std::list<int>::const_iterator, S49796}
  Container PostCall
  Original RetVal: lazyCompoundVal{0x55563692ea10,i3}
      No Stack Frame!
    No construction context!!!
  Generic PostCall
  Original RetVal: lazyCompoundVal{0x55563692ea10,i3}
      No Stack Frame!
    No construction context!!!
  Container PostCall
  Original RetVal: 1 S64b
  Updated RetVal: 1 S64b
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: 0 S64b
  Updated RetVal: 0 S64b
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: 1 S64b
  Updated RetVal: 1 S64b
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: conj_$3{long, LC1, S45775, #1}
  Updated RetVal: conj_$3{long, LC1, S45775, #1}
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: 0 S64b
  Updated RetVal: 0 S64b
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  Container PostCall
  Original RetVal: conj_$11{long, LC1, S48640, #1}
  Updated RetVal: conj_$11{long, LC1, S48640, #1}
  Container PostCall
  Original RetVal: Unknown
  Updated RetVal: Unknown
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:900:3: warning: Not a symbol
    clang_analyzer_denote(clang_analyzer_iterator_position(i1), "$i1");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:904:3: warning: TRUE
    clang_analyzer_eval(clang_analyzer_iterator_validity(i0)); //expected-warning{{TRUE}}
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:905:3: warning: FALSE
    clang_analyzer_eval(clang_analyzer_iterator_validity(i1)); //expected-warning{{TRUE}}
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:906:3: warning: TRUE
    clang_analyzer_eval(clang_analyzer_iterator_validity(i2)); //expected-warning{{TRUE}}
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:908:3: warning: $L.begin()
    clang_analyzer_express(clang_analyzer_iterator_position(i0)); // expected-warning{{$L.begin()}}
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:909:3: warning: Not a symbol
    clang_analyzer_express(clang_analyzer_iterator_position(i1)); // expected-warning{{$i1}}
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/edmbalo/llvm-project/clang/test/Analysis/iterator-modeling.cpp:911:3: warning: $L.end()
    clang_analyzer_express(clang_analyzer_iterator_position(i2)); // expected-warning{{$L.end()}}
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7 warnings generated.


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

https://reviews.llvm.org/D77229





More information about the cfe-commits mailing list