1. Aug 06, 2019
    • Sanjay Patel's avatar
      [InstCombine] add tests for binop with FMF with select operands; NFC · efc24d9d
      Sanjay Patel authored
      Baseline coverage for D65658.
      
      llvm-svn: 368028
      efc24d9d
    • Nico Weber's avatar
      gn build: Merge r368024 · b2ec7a0d
      Nico Weber authored
      llvm-svn: 368027
      b2ec7a0d
    • Simon Pilgrim's avatar
      [X86][SSE] Call SimplifyMultipleUseDemandedBits on PACKSS/PACKUS arguments. · cf62047d
      Simon Pilgrim authored
      This mainly helps to replace unused arguments with UNDEF in the case where they have multiple users.
      
      llvm-svn: 368026
      cf62047d
    • Nico Weber's avatar
      gn build: Merge r368021 · 87951c89
      Nico Weber authored
      llvm-svn: 368025
      87951c89
    • Sander de Smalen's avatar
      [AArch64] NFC: Add generic StackOffset to describe scalable offsets. · 612b0389
      Sander de Smalen authored
      To support spilling/filling of scalable vectors we need a more generic
      representation of a stack offset than simply 'int'.
      
      For this we introduce the StackOffset struct, which comprises multiple
      offsets sized by their respective MVTs. Byte-offsets will thus be a simple
      tuple such as { offset, MVT::i8 }. Adding two byte-offsets will result in a
      byte offset { offsetA + offsetB, MVT::i8 }. When two offsets have different
      types, we can canonicalise them to use the same MVT, as long as their
      runtime sizes are guaranteed to have the same size-ratio as they would have
      at compile-time.
      
      When we have both scalable- and fixed-size objects on the stack, we can 
      create an offset that is: 
      
        ({ offset_fixed, MVT::i8 } + { offset_scalable, MVT::nxv1i8 })
      
      The struct also contains a getForFrameOffset() method that is specific to
      AArch64 and decomposes the frame-offset to be used directly in instructions
      that operate on the stack or index into the stack.
      
      Note: This patch adds StackOffset as an AArch64-only concept, but we would
      like to make this a generic concept/struct that is supported by all 
      interfaces that take or return stack offsets (currently as 'int'). Since
      that would be a bigger change that is currently pending on D32530 landing,
      we thought it makes sense to first show/prove the concept in the AArch64
      target before proposing to roll this out further.
      
      Reviewers: thegameg, rovka, t.p.northover, efriedma, greened
      
      Reviewed By: rovka, greened
      
      Differential Revision: https://reviews.llvm.org/D61435
      
      llvm-svn: 368024
      612b0389
    • Simon Atanasyan's avatar
      [llvm/test/Object] Remove redundant test case. NFC · 2fbf58c6
      Simon Atanasyan authored
      Remove redundant `yaml2obj-elf-file-headers-with-e_flags.yaml` test
      case. The same functionality is checked by the `Mips/elf-flags.yaml`.
      
      llvm-svn: 368023
      2fbf58c6
    • Simon Pilgrim's avatar
      [X86] SimplifyMultipleUseDemandedBits - target shuffles might not be identity · 01d267dc
      Simon Pilgrim authored
      If we don't demand any non-undef shuffle elements then the assert will fail as all shuffle inputs would still be flagged as 'identity' safe.
      
      Exposed by an incoming patch.
      
      llvm-svn: 368022
      01d267dc
    • Alex Brachet's avatar
      [yaml2obj] Move core yaml2obj code into lib and include for use in unit tests · 3cfeaa4d
      Alex Brachet authored
      Reviewers: jhenderson, rupprecht, MaskRay, grimar, labath
      
      Reviewed By: rupprecht
      
      Subscribers: seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65255
      
      llvm-svn: 368021
      3cfeaa4d
    • Balazs Keri's avatar
      [CrossTU] Handle case when no USR could be generated during Decl search. · 4e79097d
      Balazs Keri authored
      Summary:
      When searching for a declaration to be loaded the "lookup name" for every
      other Decl is computed. If the USR can not be determined here should be
      not an assert, instead skip this Decl.
      
      Reviewers: martong
      
      Reviewed By: martong
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D65445
      
      llvm-svn: 368020
      4e79097d
    • Ilya Biryukov's avatar
      [clangd] Compute scopes eagerly in IncludeFixer · 56bdb0c5
      Ilya Biryukov authored
      Summary:
      Computing lazily leads to crashes. In particular, computing scopes may
      produce diagnostics (from inside template instantiations) and we
      currently do it when processing another diagnostic, which leads to
      crashes.
      
      Moreover, we remember and access 'Scope*' when computing scopes. This
      might lead to invalid memory access if the Scope is deleted by the time
      we run the delayed computation. We did not actually construct an example
      when this happens, though.
      
      From the VCS and review history, it seems the optimization was
      introduced in the initial version without a mention of any performance
      benchmarks justifying the performance gains. This led me to a
      conclusion that the optimization was premature, so removing it to avoid
      crashes seems like the right trade-off at that point.
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D65796
      
      llvm-svn: 368019
      56bdb0c5
    • Igor Kudrin's avatar
      Try to unbreak buildbots after r368014 · 2836cf0b
      Igor Kudrin authored
      llvm-svn: 368018
      2836cf0b
    • Simon Pilgrim's avatar
      [X86][SSE] Enable min/max partial reduction · c6735aec
      Simon Pilgrim authored
      As mentioned on D65047 / rL366933 the plan is to enable partial reduction handling wherever possible.
      
      llvm-svn: 368016
      c6735aec
    • Simon Pilgrim's avatar
      [X86][SSE] Add tests for min/max partial reduction · 23cd0da9
      Simon Pilgrim authored
      As mentioned on D65047 / rL366933 the plan is to enable partial reduction handling wherever possible.
      
      llvm-svn: 368015
      23cd0da9
    • Igor Kudrin's avatar
      Switch LLVM to use 64-bit offsets (2/5) · f26a70a5
      Igor Kudrin authored
      This updates all libraries and tools in LLVM Core to use 64-bit offsets
      which directly or indirectly come to DataExtractor.
      
      Differential Revision: https://reviews.llvm.org/D65638
      
      llvm-svn: 368014
      f26a70a5
    • Igor Kudrin's avatar
      Support 64-bit offsets in utility classes (1/5) · f5f35c5c
      Igor Kudrin authored
      Using 64-bit offsets is required to fully implement 64-bit DWARF.
      As these classes are used in many different libraries they should
      temporarily support both 32- and 64-bit offsets.
      
      Differential Revision: https://reviews.llvm.org/D64006
      
      llvm-svn: 368013
      f5f35c5c
    • Ulrich Weigand's avatar
      [Strict FP] Allow custom operation actions · 7b24dd74
      Ulrich Weigand authored
      This patch changes the DAG legalizer to respect the operation actions
      set by the target for strict floating-point operations. (Currently, the
      legalizer will usually fall back to mutate to the non-strict action
      (which is assumed to be legal), and only skip mutation if the strict
      operation is marked legal.)
      
      With this patch, if whenever a strict operation is marked as Legal or
      Custom, it is passed to the target as usual. Only if it is marked as
      Expand will the legalizer attempt to mutate to the non-strict operation.
      Note that this will now fail if the non-strict operation is itself
      marked as Custom -- the target will have to provide a Custom definition
      for the strict operation then as well.
      
      Reviewed By: hfinkel
      
      Differential Revision: https://reviews.llvm.org/D65226
      
      llvm-svn: 368012
      7b24dd74
    • Fangrui Song's avatar
      Change two unnecessary uses of llvm::size(C) to C.size() · cb4327d7
      Fangrui Song authored
      llvm-svn: 368011
      cb4327d7
    • Pavel Labath's avatar
      ObjectFileELF: permit thread-local sections with overlapping file addresses · 1177bc59
      Pavel Labath authored
      Summary:
      In an attempt to make file-address-based lookups more predictable, in D55998
      we started ignoring sections which would result in file address
      overlaps. It turns out this was too aggressive because thread-local
      sections typically will have file addresses which apear to overlap
      regular data/code. This does not cause a problem at runtime because
      thread-local sections are loaded into memory using special logic, but it
      can cause problems for lldb when trying to lookup objects by their file
      address.
      
      This patch changes ObjectFileELF to permit thread-local sections to
      overlap regular ones by essentially giving them a separate address
      space. It also makes them more symmetrical to regular sections by
      creating container sections from PT_TLS segments.
      
      Simultaneously, the patch changes the regular file address lookup logic
      to ignore sections with the thread-specific bit set. I believe this is
      what the users looking up file addresses would typically expect, as
      looking up thread-local data generally requires more complex logic (e.g.
      DWARF has a special opcode for that).
      
      Reviewers: clayborg, jingham, MaskRay
      
      Subscribers: emaste, aprantl, arichardson, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D65282
      
      llvm-svn: 368010
      1177bc59
    • Gabor Marton's avatar
      Add User docs for ASTImporter · f89c8f20
      Gabor Marton authored
      Summary:
      This document includes the description of the ASTImporter from the user/client
      perspective.
      A subsequent patch will describe the development internals.
      
      Reviewers: a_sidorin, shafik, gamesh411, balazske, a.sidorin
      
      Subscribers: rnkovacs, dkrupp, arphaman, Szelethus, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D65573
      
      llvm-svn: 368009
      f89c8f20
    • Cullen Rhodes's avatar
      [SelectionDAG] Extend base addressing modes supported by MGATHER/MSCATTER · ced419f4
      Cullen Rhodes authored
      Summary:
      Before this patch MGATHER/MSCATTER is capable of representing all
      common addressing modes, but only when illegal types are used.
      This patch adds an IndexType property so more representations
      are available when using legal types only.
      
      Original modes:
       vector of bases
       base + vector of signed scaled offsets
      
      New modes:
       base + vector of signed unscaled offsets
       base + vector of unsigned scaled offsets
       base + vector of unsigned unscaled offsets
      
      The current behaviour of addressing modes for gather/scatter remains
      unchanged.
      
      Patch by Paul Walker.
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D65636
      
      llvm-svn: 368008
      ced419f4
    • Fangrui Song's avatar
      [UpdateTestChecks] Fix an incorrect %s added in r368006 · 1eb84c4d
      Fangrui Song authored
      llvm-svn: 368007
      1eb84c4d
    • Fangrui Song's avatar
      [UpdateTestChecks] Apply some string concatenation cleanup · d24e6d7b
      Fangrui Song authored
      Some were what I suggested in D65610.
      
      llvm-svn: 368006
      d24e6d7b
    • Hans Wennborg's avatar
      test-release.sh: Reorder sed commands for the binary comparison · 757ac1ff
      Hans Wennborg authored
      llvm-svn: 368004
      757ac1ff
    • Tim Northover's avatar
      AArch64: use xzr/wzr for constant 0 in GlobalISel. · de98e92b
      Tim Northover authored
      COPYs from xzr and wzr can often be folded away entirely during register
      allocation, unlike a movz.
      
      llvm-svn: 368003
      de98e92b
    • Guillaume Chatelet's avatar
      [LLVM][Alignment] Introduce Alignment In Attributes · a7b6a7c8
      Guillaume Chatelet authored
      Summary:
      This is patch is part of a serie to introduce an Alignment type.
      See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
      See this patch for the introduction of the type: https://reviews.llvm.org/D64790
      
      Reviewers: jfb
      
      Subscribers: hiraditya, dexonsmith, llvm-commits, courbet
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65742
      
      llvm-svn: 368002
      a7b6a7c8
    • Pavel Labath's avatar
      SymbolVendor: Remove passthrough methods · 465eae36
      Pavel Labath authored
      After the recent refactorings the SymbolVendor passthrough no longer
      serve any purpose. This patch removes those methods, and updates all
      callsites to go to the symbol file directly -- in most cases that just
      means calling GetSymbolFile()->foo() instead of
      GetSymbolVendor()->foo().
      
      llvm-svn: 368001
      465eae36
    • Guillaume Chatelet's avatar
      [LLVM][Alignment] Introduce Alignment In GlobalObject · 39652137
      Guillaume Chatelet authored
      Summary:
      This is patch is part of a serie to introduce an Alignment type.
      See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
      See this patch for the introduction of the type: https://reviews.llvm.org/D64790
      
      Reviewers: jfb
      
      Subscribers: hiraditya, dexonsmith, llvm-commits, courbet
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65748
      
      Address comments
      
      llvm-svn: 368000
      39652137
    • Vitaly Buka's avatar
      [compiler-rt] Implement getrandom interception · ac9ee01f
      Vitaly Buka authored
      Summary:
      Straightforward implementation of `getrandom` syscall and libc
      hooks.
      
      Test Plan: Local MSAN failures caused by uninstrumented `getrandom`
      calls stop failing.
      
      Patch by Andrew Krieger.
      
      Reviewers: eugenis, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: srhines, kubamracek, dberris, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D65551
      
      llvm-svn: 367999
      ac9ee01f
    • Hans Wennborg's avatar
      Revert r367941 "Add a note to the release not about a potentially breaking optimization" · dba4dd1e
      Hans Wennborg authored
      The note was moved to the release_90 branch in r367997.
      
      llvm-svn: 367998
      dba4dd1e
    • Pavel Labath's avatar
      SymbolVendorELF: Perform build-id lookup even without a debug link · 001ecbde
      Pavel Labath authored
      Summary:
      The debug link and build-id lookups are two independent ways one can
      search for a separate symbol file. However, our implementation in
      SymbolVendorELF was tying the two together and refusing to look up the
      symbol file based on a build id if the file did not contain a debug
      link.
      
      This patch makes it possible to search for the symbol file with
      just one of the two methods available. To demonstrate, I split the
      build-id-case test into two, so that we test the search using both
      methods.
      
      Reviewers: jankratochvil, mgorny, clayborg, espindola, alexshap
      
      Subscribers: emaste, arichardson, MaskRay, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D65561
      
      llvm-svn: 367994
      001ecbde
    • Puyan Lotfi's avatar
      [compiler-rt] Reverting r367962 due to Fuchsia bot build-breakage. · 1b3718e6
      Puyan Lotfi authored
      llvm-svn: 367990
      1b3718e6
    • Raphael Isemann's avatar
      [lldb][NFC] Remove unnecessary cast in ClangUserExpression · efe5fd16
      Raphael Isemann authored
      llvm-svn: 367989
      efe5fd16
    • George Rimar's avatar
      [llvm/test/Object] - Cleanup and move out the yaml2obj tests. · c056dd15
      George Rimar authored
      There are multiple yaml2obj-* tests in llvm/test/Object
      folder. This is not correct place to have them and my intention
      was to move them out to test\tools\yaml2obj folder. I reviewed
      them, made some changes, and my comments are below.
      
      For all tests I:
      
      Added comments when needed.
      Moved them from llvm/test/Object to yaml2obj tests.
      Another changes performed:
      
      1) yaml2obj-invalid.yaml. It was a test for an invalid YAML input.
      I just moved it.
      
      2) yaml2obj-coff-multi-doc.test/yaml2obj-elf-multi-doc.test:
      these were a tests for testing --docnum=x functionality,
      one was for COFF and one for ELF. I merged them into one.
      
      3) yaml2obj-elf-bits-endian.test:
      I removed its 4 YAML inputs (merged into the main test).
      
      4) yaml2obj-readobj.test:
      This file has a long history. It was added to check the
      "parsing of header charactestics" initially. Then was used to test
      how yaml2obj writes the relocations. Then was upgraded to check how
      yaml2obj handle "-o" option. I think it should be heavily splitted
      and refactored in a separate patch. For now I leaved it as is, but restyled
      to reduce the changes in a follow-ups.
      
      5) yaml2obj-elf-alignment.yaml: its intention was to check we
      can set sh-addralign field. I moved, renamed (to elf-sh-addralign.yaml)
      and updated this test.
      
      6) yaml2obj-elf-file-headers.yaml: I removed it.
      It's intention was to check that
      yaml2obj handles OS/ABI and ELF type (e.g Relocatable).
      We are testing this already, for example in D64800. We might want
      to add a better (more complete) test, but keeping the existent test
      does not have much sense I think.
      
      7) yaml2obj-elf-file-headers-with-e_flags.yaml: I would describe its intention
      as "testing MIPS e_flags". It is far from being complete and tests only
      a few flags. I leaved it alone for now.
      
      8) yaml2obj-elf-rel.yaml: its intention is to check the MIPS32 relocations.
      We have a version for MIPS64 here: test\Object\Mips\elf-mips64-rel.yaml
      Seems them both are incomplete. I leaved them alone for now.
      
      9) yaml2obj-elf-rel-noref.yaml: was introduced to check the support of arm32
      R_ARM_V4BX relocatiion. I leaved it alone for now.
      
      10) yaml2obj-elf-section-basic.yaml: it just checked that we are able to recognise
      trivial fields like section 'Name', 'Type', 'Flags' and others. All of our yaml2obj
      tests are heavily using it. I just removed this test.
      
      11) yaml2obj-elf-section-invalid-size.yaml: its intention was to check the
      "Section size must be greater than or equal to the content size" error.
      I moved this test to `tools\yaml2obj\section-size-content.yaml'
      
      12) yaml2obj-elf-symbol-basic.yaml: its intention seems was to support declarations
      of the symbols in yaml2obj. I removed it. We use this in almost each test we already have.
      
      13) yaml2obj-elf-symbol-LocalGlobalWeak.yaml: its intention was to check that we can
      declare different symbol bindings. I moved it to tools\yaml2obj\elf-symbol-binding.yaml.
      
      14) yaml2obj-coff-invalid-alignment.test: check that error is reported for a too large coff
      section alignment. Moved it to tools\yaml2obj\coff-invalid-alignment.test
      
      15) yaml2obj-elf-symbol-visibility.yaml: tests ELF symbols visibility. I improved it and
      moved to tools\yaml2obj\elf-symbol-visibility.yaml and tools\obj2yaml\elf-symbol-visibility.yaml
      
      Differential revision: https://reviews.llvm.org/D65652
      
      llvm-svn: 367988
      c056dd15
    • Bill Wendling's avatar
      Use "isa" since the variable isn't used. · ebc2cf9c
      Bill Wendling authored
      llvm-svn: 367985
      ebc2cf9c
    • 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