1. Dec 16, 2018
  2. Dec 15, 2018
    • Kristof Umann's avatar
      [analyzer] Prefer returns values to out-params in CheckerRegistry.cpp · f282d272
      Kristof Umann authored
      Renaming collectCheckers to getEnabledCheckers
      Changing the functionality to acquire all enabled checkers, rather then collect
      checkers for a specific CheckerOptInfo (for example, collecting all checkers for
      { "core", true }, which meant enabling all checkers from the core package, which
      was an unnecessary complication).
      Removing CheckerOptInfo, instead of storing whether the option was claimed via a
      field, we handle errors immediately, as getEnabledCheckers can now access a
      DiagnosticsEngine. Realize that the remaining information it stored is directly
      accessible through AnalyzerOptions.CheckerControlList.
      Fix a test with -analyzer-disable-checker -verify accidentally left in.
      
      llvm-svn: 349274
      f282d272
    • Dinar Temirbulatov's avatar
      [CodeGen] Enhance machine PHIs optimization · 8c8724dd
      Dinar Temirbulatov authored
      Summary:
      Make machine PHIs optimization to work for single value register taken from
      several different copies. This is the first step to fix PR38917. This change
      allows to get rid of redundant PHIs (see opt_phis2.mir test) to make
      the subsequent optimizations (like CSE) possible and simpler.
      
      For instance, before this patch the code like this:
      
      %b = COPY %z
      ...
      %a = PHI %bb1, %a; %bb2, %b
      could be optimized to:
      
      %a = %b
      but the code like this:
      
      %c = COPY %z
      ...
      %b = COPY %z
      ...
      %a = PHI %bb1, %a; %bb2, %b; %bb3, %c
      would remain unchanged.
      With this patch the latter case will be optimized:
      
      %a = %z```.
      
      Committed on behalf of: Anton Afanasyev anton.a.afanasyev@gmail.com
      
      Reviewers: RKSimon, MatzeB
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54839
      
      llvm-svn: 349271
      8c8724dd
    • Simon Pilgrim's avatar
      Regenerate neon copy tests. NFCI. · bfbe510d
      Simon Pilgrim authored
      llvm-svn: 349270
      bfbe510d
    • Pavel Labath's avatar
      lldb-test: Improve newline handling · d211d1a5
      Pavel Labath authored
      Summary:
      Previously lldb-test's LinePrinter would output the indentation spaces
      even on completely empty lines. This is not nice, as trailing spaces get
      flagged as errors in some tools/editors, and it prevents FileCheck's
      CHECK-EMPTY from working.
      
      Equally annoying was the fact that the LinePrinter did not terminate
      it's output with a newline (instead it would leave the unterminated hanging
      indent from the last NewLine() command), which meant that the shell prompt
      following the lldb-test command came out wrong.
      
      This fixes both issues by changing how newlines are handled. NewLine(),
      which was ending the previous line ('\n') *and* begging the next line by
      printing the indent, is now "demoted" to just printing literal "\n".
      Instead, lines are now delimited via a helper Line object, which makes
      sure the line is indented and terminated in an RAII fashion. The typical
      usage would be:
      Printer.line() << "This text will be indented and terminated";
      If one needs to do more work than it will fit into a single statement,
      one can also assign the result of the line() function to a local
      variable. The line will then be terminated when that object goes out of
      scope.
      
      Reviewers: zturner
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D55597
      
      llvm-svn: 349269
      d211d1a5
    • Pavel Labath's avatar
      ELF: more section creation cleanup · 62a8254f
      Pavel Labath authored
      Summary:
      This patch attempts to move as much code as possible out of the
      CreateSections function to make room for future improvements there. Some
      of this may be slightly over-engineered (VMAddressProvider), but I
      wanted to keep the logic of this function very simple, because once I
      start taking segment headers into acount (as discussed in D55356), the
      function is going to grow significantly.
      
      While in there, I also added tests for various bits of functionality.
      
      This should be NFC, except that I changed the order of hac^H^Heuristicks
      for determining section type slightly. Previously, name-based deduction
      (.symtab -> symtab) would take precedence over type-based (SHT_SYMTAB ->
      symtab) one. In fact we would assert if we ran into a .text section with
      type SHT_SYMTAB. Though unlikely to matter in practice, this order
      seemed wrong to me, so I have inverted it.
      
      Reviewers: clayborg, krytarowski, espindola
      
      Subscribers: emaste, arichardson, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D55706
      
      llvm-svn: 349268
      62a8254f
    • Pavel Labath's avatar
      Remove /proc/pid/maps parsing code from NativeProcessLinux · c8e364e8
      Pavel Labath authored
      A utility function doing this was added in r349182, so use that instead.
      
      llvm-svn: 349267
      c8e364e8
    • Gabor Horvath's avatar
      [analyzer] Assume that we always have a SubEngine available · 21aa8db6
      Gabor Horvath authored
      The removed codepath was dead.
      
      Differential Revision: https://reviews.llvm.org/D55697
      
      llvm-svn: 349266
      21aa8db6
    • Simon Pilgrim's avatar
      Fix -Wunused-variable warning. NFCI. · 9831d405
      Simon Pilgrim authored
      llvm-svn: 349265
      9831d405
    • Simon Pilgrim's avatar
      1e1fd9c7
    • Kamil Rytarowski's avatar
      Enable test/msan/pthread_getname_np.cc for NetBSD · 7970eccc
      Kamil Rytarowski authored
      llvm-svn: 349263
      7970eccc
    • Kamil Rytarowski's avatar
      Enable SANITIZER_INTERCEPT_PTHREAD_GETNAME_NP for NetBSD · 17751e14
      Kamil Rytarowski authored
      llvm-svn: 349262
      17751e14
    • Nikita Popov's avatar
      [InstSimplify] Add tests for saturating add/sub + icmp; NFC · f61567f4
      Nikita Popov authored
      If a saturating add/sub with a constant operand is compared to
      another constant, we should be able to determine that the condition
      is always true/false in some cases (but currently don't).
      
      llvm-svn: 349261
      f61567f4
    • Roman Lebedev's avatar
      [OpenMP] Fixes for LIBOMP_OMP_VERSION=45/40 · 781a0896
      Roman Lebedev authored
      Summary:
      I have discovered this because i wanted to experiment with
      building static libomp (with openmp-4.0 support only)
      for debugging purposes.
      
      There are three kinds of problems here:
      1. `__kmp_compare_and_store_acq()` simply does not exist.
         It was added in D47903 by @jlpeyton.
         I'm guessing `__kmp_atomic_compare_store_acq()` was meant.
      2. In `__kmp_is_ticket_lock_initialized()`,
         `lck->lk.initialized` is `std::atomic<bool>`,
         while `lck` is `kmp_ticket_lock_t *`.
         Naturally, they can't be equality-compared.
         Either, it should return the value read from `lck->lk.initialized`,
         or do what `__kmp_is_queuing_lock_initialized()` does,
         compare the passed pointer with the field in the struct
         pointed by the pointer. I think the latter is correct-er choice here.
      3. Tests were not versioned.
         They assume that `LIBOMP_OMP_VERSION` is at the latest version.
      
      This does not touch LIBOMP_OMP_VERSION=30. That is still broken.
      
      Reviewers: jlpeyton, Hahnfeld, AndreyChurbanov
      
      Reviewed By: AndreyChurbanov
      
      Subscribers: guansong, jfb, openmp-commits, jlpeyton
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D55496
      
      llvm-svn: 349260
      781a0896
    • Fangrui Song's avatar
      [libclang] Add dependency on clangSerialization to unbreak... · 7643f42b
      Fangrui Song authored
      [libclang] Add dependency on clangSerialization to unbreak -DBUILD_SHARED_LIBS=1 build after rC349237
      
      Frontend headers have undefined reference on the symbol `clang::PCHContainerOperations::PCHContainerOperations()` through some shared_ptr usage. Any dependents will get the undefined reference which can only be resolved by explicit dependency on clangSerialization (due to -z defs).
      
      llvm-svn: 349259
      7643f42b
    • Fangrui Song's avatar
      [mips] Fix test typo in rL348914 · da53d873
      Fangrui Song authored
      RUN; -> RUN:
      
      llvm-svn: 349258
      da53d873
    • Kamil Rytarowski's avatar
      Fix internal_sleep() for NetBSD · 5748bb41
      Kamil Rytarowski authored
      This is a follow up of a similar fix for Linux from D55692.
      
      llvm-svn: 349257
      5748bb41
    • Martin Storsjo's avatar
      [MinGW] Produce a vtable and RTTI for dllexported classes without a key function · 4790194b
      Martin Storsjo authored
      This matches what GCC does in these situations.
      
      This fixes compiling Qt in debug mode. In release mode, references to
      the vtable of this particular class ends up optimized away, but in debug
      mode, the compiler creates references to the vtable, which is expected
      to be dllexported from a different DLL. Make sure the dllexported
      version actually ends up emitted.
      
      Differential Revision: https://reviews.llvm.org/D55698
      
      llvm-svn: 349256
      4790194b