1. Apr 07, 2020
  2. Apr 06, 2020
  3. Apr 07, 2020
    • Paula Toth's avatar
      [clang-tidy] Add check llvmlibc-implementation-in-namespace. · 00a57558
      Paula Toth authored
      Summary:
      This check makes sure all llvm-libc implementations falls within the `__llvm_libc` namespace.
      
      Reviewers: alexfh, aaron.ballman, hokein, njames93
      
      Reviewed By: aaron.ballman
      
      Subscribers: Eugene.Zelenko, libc-commits, mgorny, xazax.hun, MaskRay, cfe-commits, sivachandra
      
      Tags: #clang-tools-extra, #clang
      
      Differential Revision: https://reviews.llvm.org/D76818
      00a57558
    • Kirill Naumov's avatar
      [CFGPrinter][CallPrinter][polly] Adding distinct structure for CFGDOTInfo · 3f995ce8
      Kirill Naumov authored
      The patch introduces the system to distinctively store the information
      needed for the Control Flow Graph as well as the instrumentary needed for
      the follow-up changes: BlockFrequencyInfo and BranchProbabilityInfo.
      The patch is a part of sequence of three patches, related to graphs Heat Coloring.
      
      Reviewers: rcorcs, apilipenko, davidxl, sfertile, fedor.sergeev, eraman, bollu
      
      Differential Revision: https://reviews.llvm.org/D76820
      3f995ce8
    • Reid Kleckner's avatar
      Remove llvm::Error include form Diagnostic.h · 76221c73
      Reid Kleckner authored
      Saves ~400 related LLVM ADT. llvm/ADT/Error.h takes 90ms to parse.
      
      $ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \
          | grep '^[-+] ' | sort | uniq -c | sort -nr
          403 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Error.h
          403 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm-c/Error.h
          397 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Format.h
          397 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Debug.h
          377 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/StringExtras.h
          158 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm-c/ExternC.h
          138 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/ErrorOr.h
           13 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/raw_ostream.h
           13 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SmallString.h
            5 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/Twine.h
      76221c73
    • Jean-Michel Gorius's avatar
    • Louis Dionne's avatar
      [libc++] Make sure we execute tests with the current environment · 26727356
      Louis Dionne authored
      The new libc++ test format doesn't automatically do this (cause it
      would be the wrong place to do it).
      26727356
    • Artem Dergachev's avatar
      [analyzer] Fix NSErrorChecker false positives on constructors. · 9b1e4a82
      Artem Dergachev authored
      Constructors and delete operators cannot return a boolean value.
      Therefore they cannot possibly follow the NS/CFError-related coding
      conventions.
      
      Patch by Valeriy Savchenko!
      
      Differential Revision: https://reviews.llvm.org/D77551
      9b1e4a82
    • Artem Dergachev's avatar
      [analyzer] Fix scan-build and exploded-graph-rewriter tests on Windows. · 2ddd3325
      Artem Dergachev authored
      Detect script locations in a more straightforward way: we don't need to
      search for them because we know exactly where they are anyway.
      
      Fix a file path escaping issue in exploded-graph-rewriter with Windows
      backslashes in the path.
      
      'REQUIRES: shell' remains in scan-build tests for now, so that to
      observe the buildbot reaction on removing it in a cleaner experiment.
      
      Patch by Denys Petrov!
      
      Differential Revision: https://reviews.llvm.org/D76768
      2ddd3325
    • Reid Kleckner's avatar
      [AST] Remove DeclCXX.h dep on ASTContext.h · b36c19bc
      Reid Kleckner authored
      Saves only 36 includes of ASTContext.h and related headers.
      
      There are two deps on ASTContext.h:
      - C++ method overrides iterator types (TinyPtrVector)
      - getting LangOptions
      
      For #1, duplicate the iterator type, which is
      TinyPtrVector<>::const_iterator.
      
      For #2, add an out-of-line accessor to get the language options. Getting
      the ASTContext from a Decl is already an out of line method that loops
      over the parent DeclContexts, so if it is ever performance critical, the
      proper fix is to pass the context (or LangOpts) into the predicate in
      question.
      
      Other changes are just header fixups.
      b36c19bc
    • Yaxun (Sam) Liu's avatar
      Speed up deferred diagnostic emitter · 2c31aa2d
      Yaxun (Sam) Liu authored
      Move function emitDeferredDiags from Sema to DeferredDiagsEmitter since it
      is only used by DeferredDiagsEmitter.
      
      Also skip visited functions to avoid exponential compile time.
      
      Differential Revision: https://reviews.llvm.org/D77028
      2c31aa2d
  4. Apr 06, 2020
  5. Apr 07, 2020
  6. Apr 06, 2020
    • Jonathan Roelofs's avatar
      4faf05e5
    • Jonathan Roelofs's avatar
    • Sanjay Patel's avatar
      [ValueTracking] enhance matching of umin/umax with 'not' operands · fbb1b43f
      Sanjay Patel authored
      The cmyk test is based on the known regression that resulted from:
      rGf2fbdf76
      
      This improves on the equivalent signed min/max change:
      rG867f0c3c
      
      The underlying icmp equivalence is:
        ~X pred ~Y --> Y pred X
      
      For an icmp with constant, canonicalization results in a swapped pred:
        ~X < C -->  X > ~C
      fbb1b43f
    • BoYao Zhang's avatar
      Fix a typo in an assert message; NFC. · 2aa593be
      BoYao Zhang authored
      2aa593be
    • Matt Arsenault's avatar
      8a5f0daf
    • Matt Arsenault's avatar
      e87ec667
    • Jay Foad's avatar
      [AMDGPU] Fix inaccurate comments · ddd2f4b9
      Jay Foad authored
      ddd2f4b9
    • Louis Dionne's avatar
      [libc++] Always use -fsyntax-only in .fail.cpp tests · 2c1c4777
      Louis Dionne authored
      We had a workaround because GCC 5 does not evaluate static assertions
      that are dependent on template parameters. This commit removes the
      workaround and marks the corresponding tests as unsupported with GCC 5.
      This has the benefit of bringing the new and the old test formats closer
      without having to carry a workaround for an old compiler in the new
      test format.
      2c1c4777
    • Gabor Marton's avatar
      [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl · 8f961399
      Gabor Marton authored
      Summary:
      Currently we match the summary signature based on the arguments in the CallExpr.
      There are a few problems with this approach.
      1) Variadic arguments are handled badly. Consider the below code:
           int foo(void *stream, const char *format, ...);
           void test_arg_constraint_on_variadic_fun() {
              foo(0, "%d%d", 1, 2); // CallExpr
           }
         Here the call expression holds 4 arguments, whereas the function declaration
         has only 2 `ParmVarDecl`s. So there is no way to create a summary that
         matches the call expression, because the discrepancy in the number of
         arguments causes a mismatch.
      2) The call expression does not handle the `restrict` type qualifier.
         In C99, fwrite's signature is the following:
           size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
         However, in a call expression, like below, the type of the argument does not
         have the restrict qualifier.
          void test_fread_fwrite(FILE *fp, int *buf) {
            size_t x = fwrite(buf, sizeof(int), 10, fp);
          }
         This can result in an unmatches signature, so the summary is not applied.
      The solution is to match the summary against the referened callee
      `FunctionDecl` that we can query from the `CallExpr`.
      
      Further patches will continue with additional refactoring where I am going to
      do a lookup during the checker initialization and the signature match will
      happen there. That way, we will not check the signature during every call,
      rather we will compare only two `FunctionDecl` pointers.
      
      Reviewers: NoQ, Szelethus, gamesh411, baloghadamsoftware
      
      Subscribers: whisperity, xazax.hun, kristof.beyls, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, steakhal, danielkiss, ASDenysPetrov, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D77410
      8f961399
    • Louis Dionne's avatar
      [libc++] Make sure we include %{flags} when building with the new format · 4e52944e
      Louis Dionne authored
      Otherwise, we're missing some flags like the flags that are used by
      sanitizer builds and the 32-bit builds. In the long term, I think it
      would be better to have only %{compile_flags} and %{link_flags}, but
      for the benefit of adopting the new format by default, I think it's OK
      to add %{flags} to it.
      4e52944e
    • Louis Dionne's avatar
      [libc++] Mark is_scalar test as unsupported in C++11 and C++14 · 38e07204
      Louis Dionne authored
      That test requires std::optional. We never noticed that because our
      test format was skipping Objective-C++ tests altogether.
      38e07204