and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  1. 30 Jan, 2020 5 commits
    • Hans Wennborg's avatar
      Generate docs · e5123472
      Hans Wennborg authored
      bin/clang-tblgen -gen-diag-docs -I../clang/include \
                -I../clang/include/clang/Basic/ \
                ../clang/include/clang/Basic/Diagnostic.td -o \
                ../clang/docs/DiagnosticsReference.rst && \
          bin/clang-tblgen -gen-attr-docs -I../clang/include \
                  ../clang/include/clang/Basic/Attr.td -o \
                  ../clang/docs/AttributeReference.rst && \
          bin/clang-tblgen -gen-opt-docs -I../clang/include \
                  -I../clang/include/clang/Driver -I../llvm/include \
                  ../clang/include/clang/Driver/ClangOptionDocs.td -o \
                  ../clang/docs/ClangCommandLineReference.rst
      e5123472
    • Dimitry Andric's avatar
      Define _LIBCPP_HAS_TIMESPEC_GET for FreeBSD when appropriate · 1a595919
      Dimitry Andric authored
      Summary:
      FreeBSD got `timespec_get` support somewhere in the 12.x timeframe, but
      the C++ version check in its system headers was written incorrectly.
      This has now been fixed for both FreeBSD 13 and 12.
      
      Add checks for the corresponding `__FreeBSD_version` values, to define
      `_LIBCPP_HAS_TIMESPEC_GET` when the function is supported.
      
      Reviewers: emaste, EricWF, ldionne, mclow.lists
      
      Reviewed By: ldionne
      
      Subscribers: arichardson, krytarowski, christof, dexonsmith, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D71522
      
      (cherry picked from commit 5e416ba9)
      1a595919
    • Hans Wennborg's avatar
      Drop arm triple from test/CodeGen/AArch64/global-merge-hidden-minsize.ll · 1f95a775
      Hans Wennborg authored
      Because it's in the AArch64/ directory, it runs in cases where the arm
      target may not be available, see comment on D73235.
      
      (cherry picked from commit 6be9acdf)
      1f95a775
    • Hans Wennborg's avatar
      test-release.sh: Add MLIR to the projects list · 478ea4b4
      Hans Wennborg authored
      (cherry picked from commit ef465d0a)
      478ea4b4
    • Alex Zinenko's avatar
      [mlir][orc] unbreak MLIR ExecutionEngine after ORC changes · e40782f3
      Alex Zinenko authored
      Changes to ORC in ce2207ab changed the
      APIs in IRCompileLayer, now requiring the custom compiler to be wrapped
      in IRCompileLayer::IRCompiler. Even though MLIR relies on Orc
      CompileUtils, the type is still visible in several places in the code.
      Adapt those to the new API.
      
      (cherry picked from commit 7984b474)
      e40782f3
  2. 29 Jan, 2020 17 commits
    • Vedant Kumar's avatar
      Revert "Reland: [DWARF] Allow cross-CU references of subprogram definitions" · b516ca06
      Vedant Kumar authored
      ... as well as:
      Revert "[DWARF] Defer creating declaration DIEs until we prepare call site info"
      
      This reverts commit fa4701e1.
      
      This reverts commit 79daafc9.
      
      There have been reports of this assert getting hit:
      
      CalleeDIE && "Could not find DIE for call site entry origin
      
      (cherry picked from commit 802bec89)
      b516ca06
    • Sam McCall's avatar
      [clangd] Don't mmap source files on all platforms --> don't crash on git checkout · b28b38a5
      Sam McCall authored
      Summary:
      Previously we mmapped on unix and not on windows: on windows mmap takes
      an exclusive lock on the file and prevents the user saving changes!
      
      The failure mode on linux is a bit more subtle: if the file is changed on disk
      but the SourceManager sticks around, then subsequent operations on the
      SourceManager will fail as invariants are violated (e.g. null-termination).
      
      This commonly manifests as crashes after switching git branches with many files
      open in clangd.
      
      Nominally mmap is for performance here, and we should be willing to give some
      up to stop crashing. Measurements on my system (linux+desktop+SSD) at least
      show no measurable regression on an a fairly IO-heavy workload: drop disk caches,
      open SemaOverload.cpp, wait for first diagnostics.
      
      for i in `seq 100`; do
        for variant in mmap volatile; do
          echo 3 | sudo tee /proc/sys/vm/drop_caches
          /usr/bin/time --append --quiet -o ~/timings -f "%C %E" \
          bin/clangd.$variant -sync -background-index=0 < /tmp/mirror > /dev/null
        done
      done
      
      bin/clangd.mmap -sync -background-index=0 0:07.60
      bin/clangd.volatile -sync -background-index=0 0:07.89
      bin/clangd.mmap -sync -background-index=0 0:07.44
      bin/clangd.volatile -sync -background-index=0 0:07.89
      bin/clangd.mmap -sync -background-index=0 0:07.42
      bin/clangd.volatile -sync -background-index=0 0:07.50
      bin/clangd.mmap -sync -background-index=0 0:07.90
      bin/clangd.volatile -sync -background-index=0 0:07.53
      bin/clangd.mmap -sync -background-index=0 0:07.64
      bin/clangd.volatile -sync -background-index=0 0:07.55
      bin/clangd.mmap -sync -background-index=0 0:07.75
      bin/clangd.volatile -sync -background-index=0 0:07.47
      bin/clangd.mmap -sync -background-index=0 0:07.90
      bin/clangd.volatile -sync -background-index=0 0:07.50
      bin/clangd.mmap -sync -background-index=0 0:07.81
      bin/clangd.volatile -sync -background-index=0 0:07.95
      bin/clangd.mmap -sync -background-index=0 0:07.55
      bin/clangd.volatile -sync -background-index=0 0:07.65
      bin/clangd.mmap -sync -background-index=0 0:08.15
      bin/clangd.volatile -sync -background-index=0 0:07.54
      bin/clangd.mmap -sync -background-index=0 0:07.78
      bin/clangd.volatile -sync -background-index=0 0:07.61
      bin/clangd.mmap -sync -background-index=0 0:07.78
      bin/clangd.volatile -sync -background-index=0 0:07.55
      bin/clangd.mmap -sync -background-index=0 0:07.41
      bin/clangd.volatile -sync -background-index=0 0:07.40
      bin/clangd.mmap -sync -background-index=0 0:07.54
      bin/clangd.volatile -sync -background-index=0 0:07.42
      bin/clangd.mmap -sync -background-index=0 0:07.45
      bin/clangd.volatile -sync -background-index=0 0:07.49
      bin/clangd.mmap -sync -background-index=0 0:07.95
      bin/clangd.volatile -sync -background-index=0 0:07.66
      bin/clangd.mmap -sync -background-index=0 0:08.04
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D73617
      
      (cherry picked from commit b500c49c)
      b28b38a5
    • Florian Hahn's avatar
      [LV] Do not try to sink dead instructions. · b0536b58
      Florian Hahn authored
      Dead instructions do not need to be sunk. Currently we try and record
      the recipies for them, but there are no recipes emitted for them and
      there's nothing to sink. They can be removed from SinkAfter while
      marking them for recording.
      
      Fixes PR44634.
      
      Reviewers: rengolin, hsaito, fhahn, Ayal, gilr
      
      Reviewed By: gilr
      
      Differential Revision: https://reviews.llvm.org/D73423
      
      (cherry picked from commit a911fef3)
      b0536b58
    • Adam Balogh's avatar
      [clan-tidy] Fix false positive in bugprone-infinite-loop · d275de35
      Adam Balogh authored
      The checker bugprone-infinite-loop does not track changes of
      variables in the initialization expression of a variable
      declared inside the condition of the while statement. This
      leads to false positives, similarly to the one in the bug
      report https://bugs.llvm.org/show_bug.cgi?id=44618. This
      patch fixes this issue by enabling tracking of the variables
      of this expression as well.
      
      Differential Revision: https://reviews.llvm.org/D73270
      
      (cherry picked from commit 70f4c6e7)
      d275de35
    • Heejin Ahn's avatar
      [WebAssembly] Fix resume-only case in Emscripten EH · d18ccb8b
      Heejin Ahn authored
      Summary:
      D72308 incorrectly assumed `resume` cannot exist without a `landingpad`,
      which is not true. This sets `Changed` to true whenever we make changes
      to a function, including creating a call to `__resumeException` within a
      function without a landing pad.
      
      Reviewers: tlively
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73308
      
      (cherry picked from commit 580d7838)
      d18ccb8b
    • Lang Hames's avatar
      [ORC] Fix the LLJITWithObjectCache example to address changes in ce2207ab. · 92edb295
      Lang Hames authored
      (cherry picked from commit 97d000da)
      92edb295
    • Lang Hames's avatar
      Update clang-interpreter example to incorporate changes in ce2207ab. · 011adfcb
      Lang Hames authored
      (cherry picked from commit b54aa053)
      011adfcb
    • Lang Hames's avatar
      [ORC] Update examples to incorporate changes in ce2207ab. · 46f6f038
      Lang Hames authored
      This should fix the builders that were failing due to broken JIT examples
      after ce2207ab.
      
      (cherry picked from commit 98e55477)
      46f6f038
    • Lang Hames's avatar
      [ORC] Fix a missing move in ce2207ab. · 32056b4e
      Lang Hames authored
      This should fix the build failure at
      http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/32524
      and others.
      
      (cherry picked from commit e0a6093a)
      32056b4e
    • Lang Hames's avatar
      [ORC] Add support for emulated TLS to ORCv2. · 32723d57
      Lang Hames authored
      This commit adds a ManglingOptions struct to IRMaterializationUnit, and replaces
      IRCompileLayer::CompileFunction with a new IRCompileLayer::IRCompiler class. The
      ManglingOptions struct defines the emulated-TLS state (via a bool member,
      EmulatedTLS, which is true if emulated-TLS is enabled and false otherwise). The
      IRCompileLayer::IRCompiler class wraps an IRCompiler (the same way that the
      CompileFunction typedef used to), but adds a method to return the
      IRCompileLayer::ManglingOptions that the compiler will use.
      
      These changes allow us to correctly determine the symbols that will be produced
      when a thread local global variable defined at the IR level is compiled with or
      without emulated TLS. This is required for ORCv2, where MaterializationUnits
      must declare their interface up-front.
      
      Most ORCv2 clients should not require any changes. Clients writing custom IR
      compilers will need to wrap their compiler in an IRCompileLayer::IRCompiler,
      rather than an IRCompileLayer::CompileFunction, however this should be a
      straightforward change (see modifications to CompileUtils.* in this patch for an
      example).
      
      (cherry picked from commit ce2207ab)
      32723d57
    • Lang Hames's avatar
      [ORC] Add weak symbol support to defineMaterializing, fix for PR40074. · f7f0fd4a
      Lang Hames authored
      The MaterializationResponsibility::defineMaterializing method allows clients to
      add new definitions that are in the process of being materialized to the JIT.
      This patch adds support to defineMaterializing for symbols with weak linkage
      where the new definitions may be rejected if another materializer concurrently
      defines the same symbol. If a weak symbol is rejected it will not be added to
      the MaterializationResponsibility's responsibility set. Clients can check for
      membership in the responsibility set via the
      MaterializationResponsibility::getSymbols() method before resolving any
      such weak symbols.
      
      This patch also adds code to RTDyldObjectLinkingLayer to tag COFF comdat symbols
      introduced during codegen as weak, on the assumption that these are COFF comdat
      constants. This fixes http://llvm.org/PR40074.
      
      (cherry picked from commit 84217ad6)
      f7f0fd4a
    • Elia Geretto's avatar
      [PassManagerBuilder] Remove global extension when a plugin is unloaded · 52c1d209
      Elia Geretto authored
      This commit fixes PR39321.
      
      GlobalExtensions is not guaranteed to be destroyed when optimizer plugins are unloaded. If it is indeed destroyed after a plugin is dlclose-d, the destructor of the corresponding ExtensionFn is not mapped anymore, causing a call to unmapped memory during destruction.
      
      This commit guarantees that extensions coming from external plugins are removed from GlobalExtensions when the plugin is unloaded if GlobalExtensions has not been destroyed yet.
      
      Differential Revision: https://reviews.llvm.org/D71959
      
      (cherry picked from commit ab2300bc)
      52c1d209
    • Michael Spang's avatar
      [GlobalMerge] Preserve symbol visibility when merging globals · 425198bf
      Michael Spang authored
      Symbols created for merged external global variables have default
      visibility. This can break programs when compiling with -Oz
      -fvisibility=hidden as symbols that should be hidden will be exported at
      link time.
      
      Differential Revision: https://reviews.llvm.org/D73235
      
      (cherry picked from commit a2fb2c0d)
      425198bf
    • Peter Smith's avatar
      [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols · 81d73c6d
      Peter Smith authored
      ELF for the ARM architecture requires linkers to provide
      interworking for symbols that are of type STT_FUNC. Interworking for
      other symbols must be encoded directly in the object file. LLD was always
      providing interworking, regardless of the symbol type, this breaks some
      programs that have branches from Thumb state targeting STT_NOTYPE symbols
      that have bit 0 clear, but they are in fact internal labels in a Thumb
      function. LLD treats these symbols as ARM and inserts a transition to Arm.
      
      This fixes the problem for in range branches, R_ARM_JUMP24,
      R_ARM_THM_JUMP24 and R_ARM_THM_JUMP19. This is expected to be the vast
      majority of problem cases as branching to an internal label close to the
      function.
      
      There is at least one follow up patch required.
      - R_ARM_CALL and R_ARM_THM_CALL may do interworking via BL/BLX
        substitution.
      
      In theory range-extension thunks can be altered to not change state when
      the symbol type is not STT_FUNC. I will need to check with ld.bfd to see if
      this is the case in practice.
      
      Fixes (part of) https://github.com/ClangBuiltLinux/linux/issues/773
      
      Differential Revision: https://reviews.llvm.org/D73474
      
      (cherry picked from commit 4f38ab25)
      81d73c6d
    • Artem Belevich's avatar
      [CUDA] Assume the latest known CUDA version if we've found an unknown one. · 5777899f
      Artem Belevich authored
      This makes clang somewhat forward-compatible with new CUDA releases
      without having to patch it for every minor release without adding
      any new function.
      
      If an unknown version is found, clang issues a warning (can be disabled
      with -Wno-cuda-unknown-version) and assumes that it has detected
      the latest known version. CUDA releases are usually supersets
      of older ones feature-wise, so it should be sufficient to keep
      released clang versions working with minor CUDA updates without
      having to upgrade clang, too.
      
      Differential Revision: https://reviews.llvm.org/D73231
      
      (cherry picked from commit 12fefeef)
      5777899f
    • Hans Wennborg's avatar
      Work around PR44697 in CrashRecoveryContext · 96765815
      Hans Wennborg authored
      (cherry picked from commit 31e07692)
      96765815
    • Kadir Cetinkaya's avatar
      [clangd][Hover] Make tests hermetic by setting target triplet · 9a174549
      Kadir Cetinkaya authored
      Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=44696
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D73613
      
      (cherry picked from commit 55b0e9c9)
      9a174549
  3. 28 Jan, 2020 4 commits
  4. 27 Jan, 2020 14 commits