1. Aug 14, 2020
    • Cameron McInally's avatar
      e1a87f0a
    • Kadir Cetinkaya's avatar
      [clangd] Move clang-tidy check modifications into ClangdServer · 0464acd0
      Kadir Cetinkaya authored
      Summary:
      This enables sharing the logic between standalone clangd and embedders
      of it. The new approach should be same performance-wise, as it is only called
      once per addDocument call.
      
      This patch also introduces a blacklisting code path for disabling crashy or
      high-noise tests, until we figure out a way to make them work with clangd-setup.
      
      The biggest difference is the way we make use of preambles, hence those checks
      can't see directives coming from the preamble section of the file. The second
      thing is the fact that code might-not be compiling while clangd is trying to
      build an AST, hence some checks might choke on those incomplete ASTs.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, aaron.ballman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D83224
      0464acd0
    • Kadir Cetinkaya's avatar
      [clangd] Send EOF before resetting diagnostics consumer · 66a2e3a5
      Kadir Cetinkaya authored
      Summary:
      Some clang-tidy checkers, e.g. llvm-include-order can emit diagnostics
      at this callback (as mentioned in the comments).
      
      Clangd was resetting diag consumer to IgnoreDiags before sending EOF, hence we
      were unable to emit diagnostics for such checkers.
      
      This patch changes the order of that reset and preprocosser event to make sure
      we emit that diag.
      
      Fixes https://github.com/clangd/clangd/issues/314.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D83178
      66a2e3a5
    • Aditya Kumar's avatar
    • Aditya Kumar's avatar
      Add cold attribute to one time construction APIs · d54f5979
      Aditya Kumar authored
      _cxa_guard_acquire is used for only one purpose,
      namely guarding local static variable initialization,
      and since that purpose is definitionally cold,
      it should be attributed as cold
      
      Reviewed By: ldionne
      
      Reviewers: mclow.lists, ldionne, jfb, yfeldblum
      
      Differential Revision: https://reviews.llvm.org/D85873
      d54f5979
    • Bjorn Pettersson's avatar
      [VectorCombine] Fix for non-zero addrspace when creating vector load from scalar load · 11446b02
      Bjorn Pettersson authored
      This is a fixup to commit 43bdac29, to make sure the
      address space from the original load pointer is retained in the
      vector pointer.
      
      Resolves problem with
        Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
      due to address space mismatch.
      
      Reviewed By: spatel
      
      Differential Revision: https://reviews.llvm.org/D85912
      11446b02
    • Serguei Katkov's avatar
      [InstCombine] Handle gc.relocate(null) in one iteration · 98ba0a5f
      Serguei Katkov authored
      InstCombine adds users of transformed instruction to working list to
      process on the same iteration. However gc.relocate may have a hidden
      user (next gc.relocate) which is connected through gc.statepoint intrinsic and
      there is no direct def-use chain between them.
      
      In this case if the next gc.relocation is already processed it will not be added
      to worklist and will not be able to be processed on the same iteration.
      Let's we have the following case:
      A = gc.relocate(null)
      B = statepoint(A)
      C = gc.relocate(B, hidden(A))
      If C is already considered then after replacement of A with null, statepoint B
      instruction will be added to the queue but not C.
      C can be processed only on the next iteration.
      
      If the chain of relocation is pretty long the many iteration may be required.
      This change is to reduce the number of iteration to meet the latest changes
      related to reducing infinite loop threshold.
      
      This is a quick (not best) fix. In the follow up patches I plan to move gc relocation
      handling into statepoint handler. This should also help to remove unused gc live
      entries in statepoint bundle.
      
      Reviewers: reames, dantrushin
      Reviewed By: reames
      Subscribers: llvm-commits
      Differential Revision: https://reviews.llvm.org/D75598
      98ba0a5f
    • Sam McCall's avatar
      [clangd] Extract BackgroundIndex::Options struct. NFC · b36e22d6
      Sam McCall authored
      I've dropped the background context parameter, since we in practice just pass the
      current context there, and we now have a different way to specify context too.
      While here, clean up a couple of comments.
      
      Reviewed By: kadircet
      
      Differential Revision: https://reviews.llvm.org/D83157
      b36e22d6
    • Fangrui Song's avatar
      [ELF] --gdb-index: skip SHF_GROUP .debug_info · fb141292
      Fangrui Song authored
      -gdwarf-5 -fdebug-types-section may produce multiple .debug_info sections.  All
      except one are type units (.debug_types before DWARF v5). When constructing
      .gdb_index, we should ignore these type units. We use a simple heuristic: the
      compile unit does not have the SHF_GROUP flag. (This needs to be revisited if
      people place compile unit .debug_info in COMDAT groups.)
      
      This issue manifests as a data race: because an object file may have multiple
      .debug_info sections, we may concurrently construct `LLDDwarfObj` for the same
      file in multiple threads. The threads may access `InputSectionBase::data()`
      concurrently on the same input section. `InputSectionBase::data()` does a lazy
      uncompress() and rewrites the member variable `rawData`. A thread running zlib
      `inflate()` (transitively called by uncompress()) on a buffer with `rawData`
      tampered by another thread may fail with `uncompress failed: zlib error: Z_DATA_ERROR`.
      
      Even if no data race occurred in an optimistic ...
      fb141292
    • Peter Steinfeld's avatar
      [flang] Fix assert on character literal substrings as arguments · 19d7cc2e
      Peter Steinfeld authored
      Character literal substrings used as arguments were causing asserts.  This
      happened when the code was trying to get the DynamicType of the substring.  We
      were only recording the DynamicType of the Designator on which the substring
      was based.  For character literal substrings, the Designator was a character
      literal, and we weren't handling getting its type.
      
      I fixed this by changing the `GetType()` method for `DynamicType` to check to
      see if we were getting the type of a `Substring` and calculating the type of
      the substring by getting the number of bytes in an element of the string.
      
      I also changed the test `resolve49.f90` with some tests, one of which causes
      the original crash.
      
      Differential Revision: https://reviews.llvm.org/D85908
      19d7cc2e
    • peter klausler's avatar
      [flang] Correct manipulation of mixed complex expressions · e5caa6b5
      peter klausler authored
      Ensure that mixed complex expressions (one operand complex,
      the other not) are properly manipulated; add test.
      e5caa6b5
    • peter klausler's avatar
      [flang] Ensure Preprocessor::Define saves macro names correctly · 51cfad3a
      peter klausler authored
      This fixes problems with macros defined with -D on the command line
      and predefined macros defined in the throwaway driver program.
      51cfad3a
  2. Aug 13, 2020