1. Apr 16, 2016
    • Mandeep Singh Grang's avatar
      [LLD] Remove unwanted --check-prefix=CHECK from unit tests. NFC. · 01ae1daa
      Mandeep Singh Grang authored
      Summary:
      Removed unwanted --check-prefix=CHECK from the following unit tests:
            ELF/aarch64-gnu-ifunc.s
            ELF/gnu-ifunc-i386.s
            ELF/gnu-ifunc.s
            ELF/plt-i686.s
      
      Patch by: Mandeep Singh Grang (mgrang)
      
      Reviewers: rafael
      
      Subscribers: aemerson
      
      Projects: #lld
      
      Differential Revision: http://reviews.llvm.org/D19149
      
      llvm-svn: 266453
      01ae1daa
    • David Majnemer's avatar
      [InstCombine] Don't transform compares of calls to functions named fabs{f,l,} · 2e02ba78
      David Majnemer authored
      InstCombine wants to optimize compares of calls to fabs with zero.
      However, we didn't have the necessary legality checking to verify that
      the function call had the same behavior as fabs.
      
      llvm-svn: 266452
      2e02ba78
    • Etienne Bergeron's avatar
      [clang-tidy] Add new checker for suspicious sizeof expressions · 1f696b31
      Etienne Bergeron authored
      Summary:
      This check is finding suspicious cases of sizeof expression.
      
      Sizeof expression is returning the size (in bytes) of a type or an
      expression. Programmers often abuse or misuse this expression.
      
      This checker is adding common set of patterns to detect some
      of these bad constructs.
      
      
      Some examples found by this checker:
      
      R/packages/ifultools/ifultools/src/fra_neig.c
      ```
              /* free buffer memory */
              (void) mutil_free( dist_buff, sizeof( ctr * sizeof( double ) ) );
              (void) mutil_free( nidx_buff, sizeof( ctr * sizeof( sint32 ) ) );
      ```
      
      
      graphviz/v2_20_2/lib/common/utils.c
      ```
      static Dtdisc_t mapDisc = {
          offsetof(item, p),
          sizeof(2 * sizeof(void *)),
          offsetof(item, link),
          (Dtmake_f) newItem,
          (Dtfree_f) freeItem,
          (Dtcompar_f) cmpItem,
          NIL(Dthash_f),
          NIL(Dtmemory_f),
          NIL(Dtevent_f)
      };
      ```
      
      
      mDNSResponder/mDNSShared/dnsextd.c
      ```
      	context = ( TCPContext* ) malloc( sizeof( TCPContext ) );
      	require_action( context, exit, err = mStatus_NoMemoryErr; LogErr( "AcceptTCPConnection", "malloc" ) );
      	mDNSPlatformMemZero( context, sizeof( sizeof( TCPContext ) ) );
      	context->d		 = self;
      ```
      
      Reviewers: alexfh
      
      Subscribers: malcolm.parsons, Eugene.Zelenko, cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D19014
      
      llvm-svn: 266451
      1f696b31
    • Etienne Bergeron's avatar
      [clang-tidy] Add checker for operations between integrals and pointers · 3c5be6c9
      Etienne Bergeron authored
      Summary:
      This check is finding suspicious operations involving pointers and integral types; which are most likely bugs.
      
      Examples:
      subversion/v1_6/subversion/libsvn_subr/utf.c
      ```
      static const char *
      fuzzy_escape(const char *src, apr_size_t len, apr_pool_t *pool)
      {
        [...]
         while (src_orig < src_end)
          {
            if (! svn_ctype_isascii(*src_orig) || src_orig == '\0')   // Should be *src_orig
              {
      ```
      
      apache2/v2_2_23/modules/metadata/mod_headers.c
      ```
      static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa)
      {
        [...]
          tag->arg = '\0';   // ERROR: tag->arg has type char*
      
          /* grab the argument if there is one */
          if (*s == '{') {
              ++s;
              tag->arg = ap_getword(p,&s,'}');
          }
      ```
      
      Reviewers: alexfh
      
      Subscribers: Eugene.Zelenko, cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D19118
      
      llvm-svn: 266450
      3c5be6c9
    • Adrian Prantl's avatar
      19124d3d
    • Geoff Berry's avatar
      Fix test to require Asserts since it uses debug output. · a6a4ab3b
      Geoff Berry authored
      llvm-svn: 266448
      a6a4ab3b
    • Adrian Prantl's avatar
      Update testcase to new debug info metadata format. · 80578e7e
      Adrian Prantl authored
      llvm-svn: 266447
      80578e7e
  2. Apr 15, 2016