Skip to content
  1. Jun 17, 2011
  2. Jun 16, 2011
    • Richard Trieu's avatar
      Add a new warning when a NULL constant is used in arithmetic operations. The... · 701fb36b
      Richard Trieu authored
      Add a new warning when a NULL constant is used in arithmetic operations.  The warning will fire on cases such as:
      
      int x = 1 + NULL;
      
      llvm-svn: 133196
      701fb36b
    • Douglas Gregor's avatar
      Allow comparison between block pointers and NULL pointer · 3e85c9c5
      Douglas Gregor authored
      constants. Fixes PR10145.
      
      llvm-svn: 133179
      3e85c9c5
    • Douglas Gregor's avatar
      Teach the warning about non-POD memset/memcpy/memmove to deal with the · 18739c34
      Douglas Gregor authored
      __builtin_ versions of these functions as well as the normal function
      versions, so that it works on platforms where memset/memcpy/memmove
      are macros that map down to the builtins (e.g., Darwin). Fixes
      <rdar://problem/9372688>.
      
      llvm-svn: 133173
      18739c34
    • Fariborz Jahanian's avatar
      arc: diagnose dereferencing a __weak pointer which may be · 62c72d06
      Fariborz Jahanian authored
      null at any time. // rdar://9612030
      
      llvm-svn: 133168
      62c72d06
    • Douglas Gregor's avatar
      Implement the consistency checking for C++ [temp.deduct.call]p3, which · e65aacb9
      Douglas Gregor authored
      checks that the deduced argument type for a function call matches the
      actual argument type provided. The only place we've found where the
      consistency checking should actually cause template argument deduction
      failure is due to qualifier differences that don't fall into the realm
      of qualification conversions (which are *not* checked when we
      initially perform deduction). However, we're performing the full
      checking as specified in the standard to ensure that no other cases
      exist.
      
      Fixes PR9233 / <rdar://problem/9039590>.
      
      llvm-svn: 133163
      e65aacb9
    • Chandler Carruth's avatar
      Rework the warning for 'memset(p, 0, sizeof(p))' where 'p' is a pointer · 8b9e5a72
      Chandler Carruth authored
      and the programmer intended to write 'sizeof(*p)'. There are several
      elements to the new version:
      
      1) The actual expressions are compared in order to more accurately flag
         the case where the pattern that works for an array has been used, or
         a '*' has been omitted.
      2) Only do a loose type-based check for record types. This prevents us
         from warning when we happen to be copying around chunks of data the
         size of a pointer and the pointer types for the sizeof and
         source/dest match.
      3) Move all the diagnostics behind the runtime diagnostic filter. Not
         sure this is really important for this particular diagnostic, but
         almost everything else in SemaChecking.cpp does so.
      4) Make the wording of the diagnostic more precise and informative. At
         least to my eyes.
      5) Provide highlighting for the two expressions which had the unexpected
         similarity.
      6) Place this diagnostic under a flag: -Wsizeof-pointer-memaccess
      
      This uses the Stmt::Profile system for computing #1. Because of the
      potential cost, this is guarded by the warning flag. I'd be interested
      in feedback on how bad this is in practice; I would expect it to be
      quite cheap in practice. Ideas for a cheaper / better way to do this are
      also welcome.
      
      The diagnostic wording could likely use some further wordsmithing.
      Suggestions welcome here. The goals I had were to: clarify that its the
      interaction of 'memset' and 'sizeof' and give more reasonable
      suggestions for a resolution.
      
      An open question is whether these diagnostics should have the note
      attached for silencing by casting the dest/source pointer to void*.
      
      llvm-svn: 133155
      8b9e5a72
    • Chandler Carruth's avatar
      Skip both character pointers and void pointers when diagnosing bad · a05e09ba
      Chandler Carruth authored
      argument types for mem{set,cpy,move}. Character pointers, much like void
      pointers, often point to generic "memory", so trying to check whether
      they match the type of the argument to 'sizeof' (or other checks) is
      unproductive and often results in false positives.
      
      Nico, please review; does this miss any of the bugs you were trying to
      find with this warning? The array test case you had should be caught by
      the array-specific sizeof warning I think.
      
      llvm-svn: 133136
      a05e09ba
    • John McCall's avatar
      Weaken the type-matching rules for methods that return aggregates when · 54507ab8
      John McCall authored
      complaining about mismatches in the global method pool.
      
      llvm-svn: 133123
      54507ab8
    • Chandler Carruth's avatar
      Refactor parentheses suggestion notes to have less code duplication and · b00e8c0c
      Chandler Carruth authored
      be more consistent in how parenthesized ranges which hit macros are
      handled. Also makes the code significantly shorter, and the diagnostics
      when macros are present a bit more useful.
      
      Pair programmed w/ Matthew.
      
      llvm-svn: 133122
      b00e8c0c
    • Chandler Carruth's avatar
      Cleanup the parameter naming style. · 08dc2ba4
      Chandler Carruth authored
      llvm-svn: 133120
      08dc2ba4
    • John McCall's avatar
      Automatic Reference Counting. · 31168b07
      John McCall authored
      Language-design credit goes to a lot of people, but I particularly want
      to single out Blaine Garst and Patrick Beard for their contributions.
      
      Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
      in no particular order.
      
      llvm-svn: 133103
      31168b07
  3. Jun 15, 2011
  4. Jun 14, 2011
  5. Jun 13, 2011
Loading