1. Dec 16, 2019
    • Fangrui Song's avatar
      [MC] Delete unused MCAsmInfoELF::UsesNonexecutableStackSection after... · fdb408f3
      Fangrui Song authored
      [MC] Delete unused MCAsmInfoELF::UsesNonexecutableStackSection after EM_WEBASSEMBLY was removed in D48744
      
      This removes remnant of D15969 which hasn't been removed by D48744.
      fdb408f3
    • Lang Hames's avatar
      [Kaleidoscope][BuildingAJIT] Add a missing std::move. · 064e7d1d
      Lang Hames authored
      This should fix the build failure described in
      https://github.com/llvm/llvm-project/issues/63.
      064e7d1d
    • Raphael Isemann's avatar
      [lldb] Remove RTTI in ClangExternalASTSourceCommon based on a global map of known instances · 8280896b
      Raphael Isemann authored
      Summary:
      Currently we do our RTTI check for ClangExternalASTSourceCommon by using this global map of
      ClangExternalASTSourceCommon where every instance is registering and deregistering itself
      on creation/destruction. Then we can do the RTTI check by looking up in this map from ClangASTContext.
      
      This patch removes this whole thing and just adds LLVM-style RTTI support to ClangExternalASTSourceCommon
      which is possible with D71397.
      
      Reviewers: labath, aprantl
      
      Reviewed By: labath
      
      Subscribers: JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71398
      8280896b
    • Mark de Wever's avatar
      [AST] Use a reference in a range-based for · 29e78ec6
      Mark de Wever authored
      This avoids unneeded copies when using a range-based for loops.
      
      This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
      
      Differential Revision: https://reviews.llvm.org/D71526
      29e78ec6
    • Raphael Isemann's avatar
      [clang] Improve LLVM-style RTTI support in ExternalASTSource/ExternalSemaSource · aa455849
      Raphael Isemann authored
      Summary:
      We currently have some very basic LLVM-style RTTI support in the ExternalASTSource class hierarchy
      based on the `SemaSource` bool( to discriminate it form the ExternalSemaSource). As ExternalASTSource
      is supposed to be subclassed we should have extendable LLVM-style RTTI in this class hierarchy to make life easier
      for projects building on top of Clang.
      
      Most notably the current RTTI implementation forces LLDB to implement RTTI for its
      own ExternalASTSource class (ClangExternalASTSourceCommon) by keeping a global set of
      ExternalASTSources that are known to be ClangExternalASTSourceCommon. Projects
      using Clang currently have to dosimilar workarounds to get RTTI support for their subclasses.
      
      This patch turns this into full-fledged LLVM-style RTTI based on a static `ID` variable similar to
      other LLVM class hierarchies. Also removes the friend declaration from ExternalASTSource to
      its child class that was only used to grant access to the `SemaSource` member.
      
      Reviewers: aprantl, dblaikie, rjmccall
      
      Reviewed By: aprantl
      
      Subscribers: riccibruno, labath, lhames, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D71397
      aa455849
  2. Dec 15, 2019
  3. Dec 14, 2019
    • Nico Weber's avatar
      Fix build with older (still supported) gcc versions. · 687e98d2
      Nico Weber authored
      Older gccs can't handle multiline raw string literals in
      macro parameters.
      687e98d2
    • Nico Weber's avatar
      gn build: Merge 91dd67ef · 1de1add1
      Nico Weber authored
      1de1add1
    • Nico Weber's avatar
      Revert "[clangd] Fall back to selecting token-before-cursor if token-after-cursor fails." · f0604e73
      Nico Weber authored
      This reverts commit b60896fa.
      Breaks building with gcc:
      
      /usr/include/c++/7/bits/stl_construct.h:75:7: error: use of deleted function ‘clang::clangd::Tweak::Selection::Selection(const clang::clangd::Tweak::Selection&)’
           { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.h:28:0,
                       from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.cpp:9:
      /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/refactor/Tweak.h:49:10: note: ‘clang::clangd::Tweak::Selection::Selection(const clang::clangd::Tweak::Selection&)’ is implicitly deleted because the default definition would be ill-formed:
         struct Selection {
                ^~~~~~~~~
      /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/refactor/Tweak.h:49:10: error: use of deleted function ‘clang::clangd::SelectionTree::SelectionTree(const clang::clangd::SelectionTree&)’
      In file included from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/refactor/Tweak.h:25:0,
                       from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.h:28,
                       from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.cpp:9:
      /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/Selection.h:96:3: note: declared here
         SelectionTree(const SelectionTree &) = delete;
         ^~~~~~~~~~~~~
      
      e.g. here:
      http://lab.llvm.org:8011/builders/clang-cmake-armv7-selfhost-neon/builds/2714
      http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/41866
      f0604e73
    • Nico Weber's avatar
      6fe52776
    • John McCall's avatar
      Move ASTRecordWriter into its own header; NFC. · 2ac702aa
      John McCall authored
      Similar motivations to the movement of ASTRecordReader:
      AbstractBasicWriter.h already has quite a few dependencies,
      and it's going to get pretty large as we generate more and more
      into it.  Meanwhile, most clients don't depend on this detail of
      the implementation and shouldn't need to be recompiled.
      
      I've also made OMPClauseWriter private, like it belongs.
      2ac702aa
    • John McCall's avatar
      Move ASTRecordReader into its own header; NFC. · c2f18315
      John McCall authored
      AbstractBasicReader.h has quite a few dependencies already,
      and that's only likely to increase.  Meanwhile, ASTRecordReader
      is really an implementation detail of the ASTReader that is only
      used in a small number of places.
      
      I've kept it in a public header for the use of projects like Swift
      that might want to plug in to Clang's serialization framework.
      
      I've also moved OMPClauseReader into an implementation file,
      although it can't be made private because of friendship.
      c2f18315
    • Puyan Lotfi's avatar
      [NFC][llvm][MIRVRegNamerUtils] Refactoring GetHashableMO into switch-statement. · 816985c1
      Puyan Lotfi authored
      This refactors the if-statements handling the hashing of various
      MachineOperand types into a switch-statement. The purpose is to cover
      all the basis for all MachineOperand types while being very deliberate
      about which MachineOperand types we are not handling and why (better
      added comments). This patch is a NFC redo of https://reviews.llvm.org/D71396.
      Much of the changes present in D71396 will come in smaller follow-up patches
      that will add support for hashing the MachineOperand types that aren't
      covered piece-meal with tests for each new case.
      816985c1
    • Johannes Doerfert's avatar
    • Johannes Doerfert's avatar
      [ArgPromo][Tests] Run update_test_checks on all ArgumentPromotion tests · c0cfdd32
      Johannes Doerfert authored
      Summary:
      In preparation of D65531 as well as the reuse of these tests for the
      Attributor, we modernize them and use the update_test_checks to simplify
      updates.
      
      This was done with the update_test_checks after D68819 and D68850.
      
      Reviewers: hfinkel, vsk, dblaikie, davidxl, tejohnson, tstellar, echristo, chandlerc, efriedma, lebedev.ri
      
      Subscribers: bollu, arphaman, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68766
      c0cfdd32
    • John McCall's avatar
      MSVC build fix: forget some unneeded and incorrect friends. · d14a5693
      John McCall authored
      On MSVC, friend declarations are (incorrectly) visible even if
      not otherwise declared, which causes them to interfere with
      lookup.  ASTTypeWriter is actually in an anonymous namespace
      and cannot be ASTWriter's friend.  The others simply don't need
      to be anymore.
      d14a5693
    • Johannes Doerfert's avatar
      [Attributor] Annotate call sites of declarations with a callback · 139c9ef4
      Johannes Doerfert authored
      Even if a declaration is called, if there is a callback we might need
      the information during CG-SCC traversal (D70767).
      139c9ef4
    • Johannes Doerfert's avatar
    • Johannes Doerfert's avatar
      [Attributor][NFC] Reorder test functions · 6a05ee05
      Johannes Doerfert authored
      Since one of the functions has a personality the attribute set is
      printed. If the function is the first it should (hopefully) always be #0
      6a05ee05
    • Johannes Doerfert's avatar
      [Attributor][NFC] Simplify debug printing for abstract attributes · 3d347e28
      Johannes Doerfert authored
      This also fixes a type in the debug printing of AANoAlias.
      3d347e28
    • John McCall's avatar
      Abstract serialization: TableGen the (de)serialization code for Types. · d505e57c
      John McCall authored
      The basic technical design here is that we have three levels
      of readers and writers:
      
      - At the lowest level, there's a `Basic{Reader,Writer}` that knows
        how to emit the basic structures of the AST.  CRTP allows this to
        be metaprogrammed so that the client only needs to support a handful
        of primitive types (e.g. `uint64_t` and `IdentifierInfo*`) and more
        complicated "inline" structures such as `DeclarationName` can just
        be emitted in terms of those primitives.
      
        In Clang's binary-serialization code, these are
        `ASTRecord{Reader,Writer}`.  For now, a large number of basic
        structures are still emitted explicitly by code on those classes
        rather than by either TableGen or CRTP metaprogramming, but I
        expect to move more of these over.
      
      - In the middle, there's a `Property{Reader,Writer}` which is
        responsible for processing the properties of a larger object.  The
        object-level reader/writer asks the property-level reader/writer to
        project out a particular property, yielding a basic reader/writer
        which will be used to read/write the property's value, like so:
      
        ```
          propertyWriter.find("count").writeUInt32(node->getCount());
        ```
      
        Clang's binary-serialization code ignores this level (it uses
        the basic reader/writer as the property reader/writer and has the
        projection methods just return `*this`) and simply relies on the
        roperties being read/written in a stable order.
      
      - At the highest level, there's an object reader/writer (e.g.
        `Type{Reader,Writer}` which emits a logical object with properties.
        Think of this as writing something like a JSON dictionary literal.
      
      I haven't introduced support for bitcode abbreviations yet --- it
      turns out that there aren't any operative abbreviations for types
      besides the QualType one --- but I do have some ideas of how they
      should work.  At any rate, they'll be necessary in order to handle
      statements.
      
      I'm sorry for not disentangling the patches that added basic and type
      reader/writers; I made some effort to, but I ran out of energy after
      disentangling a number of other patches from the work.
      
      Negligible impact on module size, time to build a set of about 20
      fairly large modules, or time to read a few declarations out of them.
      d505e57c
    • John McCall's avatar
      Abstract serialization: TableGen "basic" reader/writer CRTP · 6404bd23
      John McCall authored
      classes that serialize basic values
      6404bd23
    • John McCall's avatar
      Standardize the reader methods in ASTReader; NFC. · 3ce3d23f
      John McCall authored
      There are three significant changes here:
      
      - Most of the methods to read various embedded structures (`APInt`,
        `NestedNameSpecifier`, `DeclarationName`, etc.) have been moved
        from `ASTReader` to `ASTRecordReader`.  This cleans up quite a
        bit of code which was passing around `(F, Record, Idx)` arguments
        everywhere or doing explicit indexing, and it nicely parallels
        how it works on the writer side.  It also sets us up to then move
        most of these methods into the `BasicReader`s that I'm introducing
        as part of abstract serialization.
      
        As part of this, several of the top-level reader methods (e.g.
        `readTypeRecord`) have been converted to use `ASTRecordReader`
        internally, which is a nice readability improvement.
      
      - I've standardized most of these method names on `readFoo` rather
        than `ReadFoo` (used in some of the helper structures) or `GetFoo`
        (used for some specific types for no apparent reason).
      
      - I've changed a few of these methods to return their result instead
        of reading into an argument passed by reference.  This is partly
        for general consistency and partly because it will make the
        metaprogramming easier with abstract serialization.
      3ce3d23f
    • John McCall's avatar
    • John McCall's avatar
      f6da0cf3