Skip to content
Snippets Groups Projects
  1. Oct 29, 2015
    • Sean Eveson's avatar
      [Analyzer] Widening loops which do not exit · 6b9a5f7d
      Sean Eveson authored
      Summary:
      Dear All,
      
      We have been looking at the following problem, where any code after the constant bound loop is not analyzed because of the limit on how many times the same block is visited, as described in bugzillas #7638 and #23438. This problem is of interest to us because we have identified significant bugs that the checkers are not locating. We have been discussing a solution involving ranges as a longer term project, but I would like to propose a patch to improve the current implementation.
      
      Example issue:
      ```
      for (int i = 0; i < 1000; ++i) {...something...}
      int *p = 0;
      *p = 0xDEADBEEF;
      ```
      
      The proposal is to go through the first and last iterations of the loop. The patch creates an exploded node for the approximate last iteration of constant bound loops, before the max loop limit / block visit limit is reached. It does this by identifying the variable in the loop condition and finding the value which is “one away” from the loop being false. For example, if the condition is (x < 10), then an exploded node is created where the value of x is 9. Evaluating the loop body with x = 9 will then result in the analysis continuing after the loop, providing x is incremented.
      
      The patch passes all the tests, with some modifications to coverage.c, in order to make the ‘function_which_gives_up’ continue to give up, since the changes allowed the analysis to progress past the loop.
      
      This patch does introduce possible false positives, as a result of not knowing the state of variables which might be modified in the loop. I believe that, as a user, I would rather have false positives after loops than do no analysis at all. I understand this may not be the common opinion and am interested in hearing your views. There are also issues regarding break statements, which are not considered. A more advanced implementation of this approach might be able to consider other conditions in the loop, which would allow paths leading to breaks to be analyzed.
      
      Lastly, I have performed a study on large code bases and I think there is little benefit in having “max-loop” default to 4 with the patch. For variable bound loops this tends to result in duplicated analysis after the loop, and it makes little difference to any constant bound loop which will do more than a few iterations. It might be beneficial to lower the default to 2, especially for the shallow analysis setting.
      
      Please let me know your opinions on this approach to processing constant bound loops and the patch itself.
      
      Regards,
      
      Sean Eveson
      SN Systems - Sony Computer Entertainment Group
      
      Reviewers: jordan_rose, krememek, xazax.hun, zaks.anna, dcoughlin
      
      Subscribers: krememek, xazax.hun, cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D12358
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251621 91177308-0d34-0410-b5e6-96231b3b80d8
      6b9a5f7d
    • Xinliang David Li's avatar
      Fix a soon to be invalid test · 82019f1f
      Xinliang David Li authored
      Remove a check that won't be valid when LLVM stops
      emitting runtime hook user function.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251611 91177308-0d34-0410-b5e6-96231b3b80d8
      82019f1f
    • Saleem Abdulrasool's avatar
      test: fix overzealous match · ea69f163
      Saleem Abdulrasool authored
      Accidentally made the test too strict.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251603 91177308-0d34-0410-b5e6-96231b3b80d8
      ea69f163
    • Saleem Abdulrasool's avatar
      Driver: CrossWindows sanitizers link support · 0e6de217
      Saleem Abdulrasool authored
      Add the required libraries to the linker invocation when building with
      sanitizers.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251600 91177308-0d34-0410-b5e6-96231b3b80d8
      0e6de217
    • Saleem Abdulrasool's avatar
      Driver: inline some small arrays · ed571a8f
      Saleem Abdulrasool authored
      Use an initializer list to remove a couple of small static arrays.  NFC.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251599 91177308-0d34-0410-b5e6-96231b3b80d8
      ed571a8f
    • Saleem Abdulrasool's avatar
      Driver: tweak CrossWindows sanitizer support · 7f9c02c9
      Saleem Abdulrasool authored
      Indicate support for ASAN on the CrossWindows toolchain.  Although this is
      insufficient, this at least permits the handling of the driver flag.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251598 91177308-0d34-0410-b5e6-96231b3b80d8
      7f9c02c9
    • Devin Coughlin's avatar
      [analyzer] Update analyzer website for release of checker-277. · 28d38895
      Devin Coughlin authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251591 91177308-0d34-0410-b5e6-96231b3b80d8
      28d38895
    • George Burgess IV's avatar
      [Sema] Implement -Wdouble-promotion for clang. · 0a022661
      George Burgess IV authored
      GCC has a warning called -Wdouble-promotion, which warns you when
      an implicit conversion increases the width of a floating point type.
      
      This is useful when writing code for architectures that can perform
      hardware FP ops on floats, but must fall back to software emulation for
      larger types (i.e. double, long double).
      
      This fixes PR15109 <https://llvm.org/bugs/show_bug.cgi?id=15109>.
      
      Thanks to Carl Norum for the patch!
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251588 91177308-0d34-0410-b5e6-96231b3b80d8
      0a022661
    • Reid Kleckner's avatar
      [WinEH] Mark calls inside cleanups as noinline · 8207ab01
      Reid Kleckner authored
      This works around PR25162. The MSVC tables make it very difficult to
      correctly inline a C++ destructor that contains try / catch.  We've
      attempted to address PR25162 in LLVM's backend, but it feels pretty
      infeasible.  MSVC and ICC both appear to avoid inlining such complex
      destructors.
      
      Long term, we want to fix this by making the inliner smart enough to
      know when it is inlining into a cleanup, so it can inline simple
      destructors (~unique_ptr and ~vector) while avoiding destructors
      containing try / catch.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251576 91177308-0d34-0410-b5e6-96231b3b80d8
      8207ab01
  2. Oct 28, 2015
  3. Oct 27, 2015
Loading