Skip to content
  1. Jan 27, 2019
  2. Jan 26, 2019
    • Kristof Umann's avatar
      [analyzer] Add CheckerManager::getChecker, make sure that a registry function... · 204bf2bb
      Kristof Umann authored
      [analyzer] Add CheckerManager::getChecker, make sure that a registry function registers no more than 1 checker
      
      This patch effectively fixes the almost decade old checker naming issue.
      The solution is to assert when CheckerManager::getChecker is called on an
      unregistered checker, and assert when CheckerManager::registerChecker is called
      on a checker that is already registered.
      
      Differential Revision: https://reviews.llvm.org/D55429
      
      llvm-svn: 352292
      204bf2bb
    • Simon Pilgrim's avatar
      [X86] combineAddOrSubToADCOrSBB/combineCarryThroughADD - use oneuse for entire SDNode · a914fa4d
      Simon Pilgrim authored
      Fix issue noted in D57281 that only tested the one use for the SDValue (the result flag), not the entire SUB.
      
      I've added the getNode() to make it clearer what is intended than just the -> redirection.
      
      llvm-svn: 352291
      a914fa4d
    • Kristof Umann's avatar
      Fix a lit test failure after D54438 · 64c3fe91
      Kristof Umann authored
      llvm-svn: 352290
      64c3fe91
    • Simon Pilgrim's avatar
      [X86] combineCarryThroughADD - add support for X86::COND_A commutations (PR24545) · 37a8e65a
      Simon Pilgrim authored
      As discussed on PR24545, we should try to commute X86::COND_A 'icmp ugt' cases to X86::COND_B 'icmp ult' to more optimally bind the carry flag output to a SBB instruction.
      
      Differential Revision: https://reviews.llvm.org/D57281
      
      llvm-svn: 352289
      37a8e65a
    • Simon Pilgrim's avatar
      [X86] Fold X86ISD::SBB(ISD::SUB(X,Y),0) -> X86ISD::SBB(X,Y) (PR25858) · b7a15acd
      Simon Pilgrim authored
      We often generate X86ISD::SBB(X, 0) for carry flag arithmetic.
      
      I had tried to create test cases for the ADC equivalent (which often uses the same pattern) but haven't managed to find anything yet.
      
      Differential Revision: https://reviews.llvm.org/D57169
      
      llvm-svn: 352288
      b7a15acd
    • Kristof Umann's avatar
      [analyzer] Reimplement dependencies between checkers · 8fd74ebf
      Kristof Umann authored
      Unfortunately, up until now, the fact that certain checkers depended on one
      another was known, but how these actually unfolded was hidden deep within the
      implementation. For example, many checkers (like RetainCount, Malloc or CString)
      modelled a certain functionality, and exposed certain reportable bug types to
      the user. For example, while MallocChecker models many many different types of
      memory handling, the actual "unix.MallocChecker" checker the user was exposed to
      was merely and option to this modeling part.
      
      Other than this being an ugly mess, this issue made resolving the checker naming
      issue almost impossible. (The checker naming issue being that if a checker
      registered more than one checker within its registry function, both checker
      object recieved the same name) Also, if the user explicitly disabled a checker
      that was a dependency of another that _was_ explicitly enabled, it implicitly,
      without "telling" the user, reenabled it.
      
      Clearly, changing this to a well structured, declarative form, where the
      handling of dependencies are done on a higher level is very much preferred.
      
      This patch, among the detailed things later, makes checkers declare their
      dependencies within the TableGen file Checkers.td, and exposes the same
      functionality to plugins and statically linked non-generated checkers through
      CheckerRegistry::addDependency. CheckerRegistry now resolves these dependencies,
      makes sure that checkers are added to CheckerManager in the correct order,
      and makes sure that if a dependency is disabled, so will be every checker that
      depends on it.
      
      In detail:
      
      * Add a new field to the Checker class in CheckerBase.td called Dependencies,
      which is a list of Checkers.
      * Move unix checkers before cplusplus, as there is no forward declaration in
      tblgen :/
      * Add the following new checkers:
        - StackAddrEscapeBase
        - StackAddrEscapeBase
        - CStringModeling
        - DynamicMemoryModeling (base of the MallocChecker family)
        - IteratorModeling (base of the IteratorChecker family)
        - ValistBase
        - SecuritySyntaxChecker (base of bcmp, bcopy, etc...)
        - NSOrCFErrorDerefChecker (base of NSErrorChecker and  CFErrorChecker)
        - IvarInvalidationModeling (base of IvarInvalidation checker family)
        - RetainCountBase (base of RetainCount and OSObjectRetainCount)
      * Clear up and registry functions in MallocChecker, happily remove old FIXMEs.
      * Add a new addDependency function to CheckerRegistry.
      * Neatly format RUN lines in files I looked at while debugging.
      
      Big thanks to Artem Degrachev for all the guidance through this project!
      
      Differential Revision: https://reviews.llvm.org/D54438
      
      llvm-svn: 352287
      8fd74ebf
    • Amaury Sechet's avatar
    • Kristof Umann's avatar
      [analyzer] Fix an bug where statically linked, but not registered checkers weren't recognized · 98217adb
      Kristof Umann authored
      My last patch, D56989, moved the validation of whether a checker exists into
      its constructor, but we do support statically linked (and non-plugin) checkers
      that were do not have an entry in Checkers.td. However, the handling of this
      happens after the creation of the CheckerRegistry object.
      
      This patch fixes this bug by moving even this functionality into
      CheckerRegistry's constructor.
      
      llvm-svn: 352284
      98217adb
    • Simon Pilgrim's avatar
    • Kristof Umann's avatar
      [analyzer][NFC] Keep track of whether enabling a checker was explictly... · 3daa2455
      Kristof Umann authored
      [analyzer][NFC] Keep track of whether enabling a checker was explictly specified in command line arguments
      
      I added a new enum to CheckerInfo, so we can easily track whether the check is
      explicitly enabled, explicitly disabled, or isn't specified in this regard.
      Checkers belonging in the latter category may be implicitly enabled through
      dependencies in the followup patch. I also made sure that this is done within
      CheckerRegisty's constructor, leading to very significant simplifications in
      its query-like methods.
      
      Differential Revision: https://reviews.llvm.org/D56989
      
      llvm-svn: 352282
      3daa2455
    • Simon Pilgrim's avatar
Loading