1. Aug 06, 2019
    • Shoaib Meenai's avatar
      [DirectoryWatcher] Fix asserts Mac builds · fe08528c
      Shoaib Meenai authored
      Add a missing semicolon after an assert. Remove the period from the
      assert message while I'm here, because we don't usually have those.
      
      llvm-svn: 367984
      fe08528c
    • Pavel Labath's avatar
      Fix line table resolution near the end of a section · a3bdcdf7
      Pavel Labath authored
      Summary:
      lld r367537 changed the way the linker organizes sections and segments.
      This exposed an lldb bug and caused some tests to fail.
      
      In all of the failing tests the root cause was the same -- when we were
      trying to resolve the last address in the line_table section, we failed
      because it pointed past the end of the section.
      
      This patch changes the line table address resolution code to back up the
      address by one for end-of-sequence entries. This ensures the address
      still points inside a section/module even if the line table sequence
      ends at the very end of a section.
      
      It also reverts the linker flags which were added to the failing tests
      to restore previous behavior.
      
      Reviewers: clayborg, jingham
      
      Subscribers: mgorny, MaskRay, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D65647
      
      llvm-svn: 367983
      a3bdcdf7
    • Shoaib Meenai's avatar
      [Driver] Introduce -stdlib++-isystem · b50e8c59
      Shoaib Meenai authored
      There are times when we wish to explicitly control the C++ standard
      library search paths used by the driver. For example, when we're
      building against the Android NDK, we might want to use the NDK's C++
      headers (which have a custom inline namespace) even if we have C++
      headers installed next to the driver. We might also be building against
      a non-standard directory layout and wanting to specify the C++ standard
      library include directories explicitly.
      
      We could accomplish this by passing -nostdinc++ and adding an explicit
      -isystem for our custom search directories. However, users of our
      toolchain may themselves want to use -nostdinc++ and a custom C++ search
      path (libc++'s build does this, for example), and our added -isystem
      won't respect the -nostdinc++, leading to multiple C++ header
      directories on the search path, which causes build failures.
      
      Add a new driver option -stdlib++-isystem to support this use case.
      Passing this option suppresses adding the default C++ library include
      paths in the driver, and it also respects -nostdinc++ to allow users to
      still override the C++ library paths themselves.
      
      It's a bit unfortunate that we end up with both -stdlib++-isystem and
      -cxx-isystem, but their semantics differ significantly. -cxx-isystem is
      unaffected by -nostdinc++ and is added to the end of the search path
      (which is not appropriate for C++ standard library headers, since they
      often #include_next into other system headers), while -stdlib++-isystem
      respects -nostdinc++, is added to the beginning of the search path, and
      suppresses the default C++ library include paths.
      
      Differential Revision: https://reviews.llvm.org/D64089
      
      llvm-svn: 367982
      b50e8c59
    • Fangrui Song's avatar
      [Driver] Prioritize SYSROOT/usr/include over RESOURCE_DIR/include on linux-musl · c37022b2
      Fangrui Song authored
      On a musl-based Linux distribution, stdalign.h stdarg.h stdbool.h stddef.h stdint.h stdnoreturn.h are expected to be provided by musl (/usr/include), instead of RESOURCE_DIR/include.
      Reorder RESOURCE_DIR/include to fix the search order problem.
      (Currently musl doesn't provide stdatomic.h. stdatomic.h is still found in RESOURCE_DIR/include.)
      
      gcc on musl has a similar search order:
      
      ```
       /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0
       /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/x86_64-alpine-linux-musl
       /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/backward
       /usr/local/include
       /usr/include/fortify
       /usr/include
       /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/include
      ```
      
      This is different from a glibc-based distribution where RESOURCE_DIR/include is placed before SYSROOT/usr/include.
      
      According to the maintainer of musl:
      
      > musl does not support use/mixing of compiler-provided std headers with its headers, and intentionally has no mechanism for communicating with such headers as to which types have already been defined or still need to be defined. If the current include order, with clang's headers before the libc ones, works in some situations, it's only by accident.
      
      Reviewed by: phosek
      
      Differential Revision: https://reviews.llvm.org/D65699
      
      llvm-svn: 367981
      c37022b2
    • Hideki Saito's avatar
      [LV][NFC] Share the LV illegality reporting with LoopVectorize. · ec818d7f
      Hideki Saito authored
       
      Reviewers: hsaito, fhahn, rengolin
       
      Reviewed By: rengolin
       
      Patch by psamolysov, thanks!
       
      Differential Revision: https://reviews.llvm.org/D62997
      
      llvm-svn: 367980
      ec818d7f
    • Puyan Lotfi's avatar
      [clang][DirectoryWatcher] Adding llvm::Expected error handling to create. · ef74924f
      Puyan Lotfi authored
      Prior to this patch Unix style errno error reporting from the inotify layer was
      used by DirectoryWatcher::create to simply return a nullptr on error. This
      would generally be ok, except that in LLVM we have much more robust error
      reporting through the facilities of llvm::Expected.
      
      The other critical thing I stumbled across was that the unit tests for
      DirectoryWatcher were not failing abruptly when inotify_init() was reporting an
      error, but would continue with the testing and eventually hit a deadlock in a
      pathological machine state (ie in the unit test, the return nullptr on ::create
      was ignored).
      
      Generally this pathological state never happens on any build bot, so it is
      totally understandable that it was overlooked, but on a Linux desktop running
      a dubious desktop environment (which I will not name) there is a chance that
      said desktop environment could use up enough inotify instances to exceed the
      user's limit. These are the conditions that led me to hit the deadlock I am
      addressing in this patch with more robust error handling.
      
      With the new llvm::Expected error handling when your system runs out of inotify
      instances for your user, the unit test will be forced to handle the error or
      crash and report the issue to the user instead of weirdly deadlocking on a
      condition variable wait.
      
      Differential Revision: https://reviews.llvm.org/D65704
      
      llvm-svn: 367979
      ef74924f
    • Jonas Devlieghere's avatar
      [Gardening] Remove dead code from ASTDumper (NFC) · d099c893
      Jonas Devlieghere authored
      These functions are not referenced.
      
      llvm-svn: 367978
      d099c893
    • Jonas Devlieghere's avatar
      [Gardening] Remove dead code from ScriptInterpreterPython (NFC) · ea1752a7
      Jonas Devlieghere authored
      The terminal state is never saved or restored.
      
      llvm-svn: 367977
      ea1752a7
    • Jonas Devlieghere's avatar
      [Gardening] Remove dead code from IOHandler (NFC) · 3c3dce25
      Jonas Devlieghere authored
      These functions are not referenced.
      
      llvm-svn: 367976
      3c3dce25
    • Jonas Devlieghere's avatar
      Remove unused function 'SetMangledCounterparts' (NFC) · 78dfc945
      Jonas Devlieghere authored
      This function is not referenced.
      
      llvm-svn: 367975
      78dfc945
    • Matt Arsenault's avatar
      CodeGen: Migration to using Register · f4d3113a
      Matt Arsenault authored
      llvm-svn: 367974
      f4d3113a
    • Matt Arsenault's avatar
      Builtins: Start adding half versions of math builtins · acd0a53c
      Matt Arsenault authored
      The implementation of the OpenCL builtin currently library uses 2
      different hacks to get to the corresponding IR intrinsics from the
      source. This will allow removal of those.
      
      This is the set that is currently used (minus a few vector ones).
      
      llvm-svn: 367973
      acd0a53c
    • Nico Weber's avatar
      gn build: Add AMDGPU target · 96dd95fd
      Nico Weber authored
      Differential Revision: https://reviews.llvm.org/D65767
      
      llvm-svn: 367972
      96dd95fd
    • Nico Weber's avatar
      gn build: Leave a comment why "-gen-searchable-table" tablegen()s are not... · 08fd6596
      Nico Weber authored
      gn build: Leave a comment why "-gen-searchable-table" tablegen()s are not called FooGenSearchableTable
      
      llvm-svn: 367971
      08fd6596
    • Nico Weber's avatar
      gn build: Merge r367917 · 139fb5d4
      Nico Weber authored
      llvm-svn: 367970
      139fb5d4
    • Austin Kerbow's avatar
      Re-commit: [AMDGPU] Use S_DENORM_MODE for gfx10 · a05c3841
      Austin Kerbow authored
      Summary: During fdiv32 lowering use S_DENORM_MODE to select denorm mode in gfx10.
      
      Reviewers: arsenm, rampitec
      
      Reviewed By: arsenm, rampitec
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65620
      
      llvm-svn: 367969
      a05c3841
    • Puyan Lotfi's avatar
      [NFC][DirectoryWatchedTests] Unlocks mutexes before signaling condition variable · fa086d70
      Puyan Lotfi authored
      This should not affect actual behavior, but should pessimize the threading less
      by avoiding the situation where:
      
        * mutex is still locked
        * T1 notifies on condition variable
        * T2 wakes to check mutex
        * T2 sees mutex is still locked
        * T2 waits
        * T1 unlocks mutex
        * T2 tries again, acquires mutex.
      
      Differential Revision: https://reviews.llvm.org/D65708
      
      llvm-svn: 367968
      fa086d70
    • Daniel Sanders's avatar
      Fix another MSVC issue after 367965 · de406081
      Daniel Sanders authored
      Repeated the fix for MCRegister in Register
      
      This reverts r367932 (git commit eac86ec2)
      
      llvm-svn: 367967
      de406081
    • Johannes Doerfert's avatar
      [Attributor][NFC] Outline common pattern into helper method · 21fe0a31
      Johannes Doerfert authored
      This helper will also allow to also place logic to determine if an
      abstract attribute is necessary in the first place.
      
      llvm-svn: 367966
      21fe0a31
    • Daniel Sanders's avatar
      Re-commit Register/MCRegister: Add conversion operators to avoid use of... · 269191ea
      Daniel Sanders authored
      Re-commit Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC
      
      Added two more conversions to satisfy MSVC and moved the declaration of
      MCPhysReg to MCRegister.h to enable that
      
      This reverts r367932 (git commit eac86ec2)
      
      llvm-svn: 367965
      269191ea
    • Johannes Doerfert's avatar
      [Attributor][Fix] Add const qualifier · af615163
      Johannes Doerfert authored
      I forgot to add this as part of the last commit.
      
      llvm-svn: 367964
      af615163
    • Davide Italiano's avatar
      Revert "[CompilerType] Simplify the interface a bit more.." · 78f05d35
      Davide Italiano authored
      There's actually a test downstream that fails with this.
      I think we can still get rid of it, but I need to do some work
      there first.
      
      llvm-svn: 367963
      78f05d35
    • Puyan Lotfi's avatar
      [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3) · c9d90d50
      Puyan Lotfi authored
      Third landing attempt: Added "if (HAVE_LIBCXX)" to keep Green Dragon green.
      
      Haven't found a better way to pass the libcxx include path for building
      compiler-rt with libcxx; this seems to be missing only for xray.
      
      Differential Revision: https://reviews.llvm.org/D65307
      
      llvm-svn: 367962
      c9d90d50
    • Johannes Doerfert's avatar
      [Attributor] Provide a generic interface to check live instructions · d0f64009
      Johannes Doerfert authored
      Summary:
      Similar to `Attributor::checkForAllCallSites`, we now provide such
      functionality for instructions of a certain opcode through
      `Attributor::checkForAllInstructions` and the convenient wrapper
      `Attributor::checkForAllCallLikeInstructions`. This cleans up code,
      avoids duplication, and simplifies the usage of liveness information.
      
      Reviewers: sstefan1, uenoku
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65731
      
      llvm-svn: 367961
      d0f64009
    • Shiva Chen's avatar
      [RISCV] Custom legalize i32 operations for RV64 to reduce signed extensions · b12056bd
      Shiva Chen authored
      Differential Revision: https://reviews.llvm.org/D65434
      
      llvm-svn: 367960
      b12056bd
    • Peter Collingbourne's avatar
      Silence ubsan after r367926. · f0380bac
      Peter Collingbourne authored
      Fixes e.g.
      http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/14273
      
      We can't left shift here because left shifting of a negative number is UB.
      The same doesn't apply to unsigned arithmetic, but switching to unsigned
      doesn't appear to stop ubsan from complaining, so we need to mask out the
      high bits.
      
      llvm-svn: 367959
      f0380bac
    • Diego Astiazaran's avatar
      [clang-doc] Fix link generation · 15e468e0
      Diego Astiazaran authored
      Before making a link to a reference it is required to check that the
      reference has a path (eg. primitives won't have paths).
      This was done by checking if the path was empty; that worked because
      when generating paths the outdirectory was included, so if the path was
      assigned it had that outdirectory at least.
      The path generation was changed, it's now only the composite of the
      namespaces without the outdirectory. So if the info is in the global
      namespace the path would be empty and the old check wouldn't work as expected.
      A new attribute has been added to the Reference struct that indicates if
      the info's parent is the global namespace.
      Paths generation now fails if the path is empty and if the info
      is not in the global namespace.
      
      Differential Revision: https://reviews.llvm.org/D64958
      
      llvm-svn: 367958
      15e468e0
    • Davide Italiano's avatar
      [CompilerType] Simplify the interface a bit more.. · b31f60b9
      Davide Italiano authored
      Summary:
      .. removing IsMeaninglessWithoutTypeResolution(). I'm fairly
      confident this was introduced to support swift, where
      static types [without dynamic counterpart] don't carry a lot
      of value. Since then, the formatters and dynamic type resolution
      has been rewritten, and we employ different solutions. This function
      is unused here too, so let's get read of it.
      
      <rdar://problem/36377967>
      
      Reviewers: shafik, JDevlieghere, alex, compnerd, teemperor
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D65782
      
      llvm-svn: 367957
      b31f60b9
    • Jonas Devlieghere's avatar
      [CMake] Remove check for the readline target. · 9bb525ad
      Jonas Devlieghere authored
      This was introduced when we were building a custom readline Python
      module on Linux [1]. Now that the readline  target doesn't exist
      anymore, it's safe to remove this dependency.
      
      This fixes https://llvm.org/PR25136
      
      [1] https://reviews.llvm.org/D13268
      
      llvm-svn: 367956
      9bb525ad
    • JF Bastien's avatar
      [NFC] Remove useless static · 25a255f5
      JF Bastien authored
      The function is already inline in the header, static isn't what we want.
      
      llvm-svn: 367955
      25a255f5
    • Puyan Lotfi's avatar
      37fe40c3
    • Johannes Doerfert's avatar
      [Attributor] Introduce the IRAttribute helper struct · eccdf085
      Johannes Doerfert authored
      Summary:
      Certain properties, e.g., an AttrKind, are not shared among all abstract
      attributes. This patch extracts the functionality into a helper struct.
      
      Reviewers: uenoku, sstefan1
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65712
      
      llvm-svn: 367953
      eccdf085
    • Johannes Doerfert's avatar
      [Attributor] Make abstract attributes stateless · fb69f768
      Johannes Doerfert authored
      To remove boilerplate, mostly passing through values to the
      AbstractAttriubute base class, we extract the state into an IRPosition
      helper. There is no function change intended but the IRPosition struct
      will provide more functionality down the line.
      
      Reviewers: sstefan1, uenoku
      
      Subscribers: hiraditya, bollu, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65711
      
      llvm-svn: 367952
      fb69f768
    • Johannes Doerfert's avatar
      [Attributor] Use proper ID for attribute lookup · 24020625
      Johannes Doerfert authored
      Summary:
      The new scheme is similar to the pass manager and dyn_cast scheme where
      we identify classes by the address of a static member. This is better
      than the old scheme in which we had to "invent" new Attributor enums if
      there was no corresponding one.
      
      Reviewers: sstefan1, uenoku
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65710
      
      llvm-svn: 367951
      24020625
    • Johannes Doerfert's avatar
      [Attributor][NFCI] Avoid duplication of the InformationCache reference · 007153e9
      Johannes Doerfert authored
      Summary:
      Instead of storing the reference to the InformationCache we now pass it
      whenever it might be needed.
      
      Reviewers: sstefan1, uenoku
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65709
      
      llvm-svn: 367950
      007153e9
    • Jonathan Peyton's avatar
      [OpenMP] Add support for GOMP_*_nonmonotonic_* functions · 73d5abd8
      Jonathan Peyton authored
      Patch by Isuru Fernando
      
      Differential Revision: https://reviews.llvm.org/D65714
      
      llvm-svn: 367949
      73d5abd8
    • Johannes Doerfert's avatar
      [Attributor] Deduce the "no-return" attribute for functions · e83f3039
      Johannes Doerfert authored
      A function is "no-return" if we never reach a return instruction, either
      because there are none or the ones that exist are dead.
      
      Test have been adjusted:
        - either noreturn was added, or
        - noreturn was avoided by modifying the code.
      
      The new noreturn_{sync,async} test make sure we do handle invoke
      instructions with a noreturn (and potentially nowunwind) callee
      correctly, even in the presence of potential asynchronous exceptions.
      
      llvm-svn: 367948
      e83f3039
    • George Burgess IV's avatar
      [Sema] attempt to appease buildbots after r367940 · a5c25c5d
      George Burgess IV authored
      A buildbot got angry about this new test, with error messages like:
      
      warn-nullchar-nullptr.c Line 16: use of undeclared identifier 'u'
      
      It looks like this `u'c'` syntax was introduced in C11; I'm guessing
      some bots may default to something before that. Let's see if explicitly
      specifying the standard version makes it happy...
      
      llvm-svn: 367947
      a5c25c5d
    • Davide Italiano's avatar
      [CompilerType] Remove an unused function. · d32d5db4
      Davide Italiano authored
      Summary:
      This simplifies the interface, as I'm trying to understand how
      we can upstream swift support.
      
      <rdar://problem/36377967>
      
      Reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D65781
      
      llvm-svn: 367946
      d32d5db4
    • Amara Emerson's avatar
      [GlobalISel][CallLowering] Rename isArgumentHandler() -> isIncomingArgumentHandler() · bc1172df
      Amara Emerson authored
      Previous name and comment incorrectly implied it was just for formal arg handlers,
      which is not true.
      
      llvm-svn: 367945
      bc1172df