Skip to content
  1. Jun 12, 2020
    • Stanislav Mekhanoshin's avatar
    • Richard Smith's avatar
      Don't diagnose a redeclaration of a deduction guide if the prior · c32d261e
      Richard Smith authored
      declaration is not visible.
      
      In passing, add a test for a similar case of conflicting redeclarations
      of internal-linkage structured bindings. (This case already works).
      c32d261e
    • Erich Keane's avatar
      Fix non-determinism issue with implicit lambda captures. · 1eddce41
      Erich Keane authored
      We were using llvm::SmallPtrSet for our ODR-use set which was also used
      for instantiating the implicit lambda captures. The order in which the
      captures are added depends on this, so the lambda's layout ended up
      changing.  The test just uses floats, but this was noticed with other
      types as well.
      
      This test replaces the short-lived SmallPtrSet (it lasts only for an
      expression, which, though is a long time for lambdas, is at least not
      forever) with a SmallSetVector.
      1eddce41
    • Sam McCall's avatar
      Handle delayed-template-parsing functions imported into a non-dtp TU · 05ed3efc
      Sam McCall authored
      Summary:
      DelayedTemplateParsing is marked as BENIGN_LANGOPT, so we are allowed to
      use a delayed template in a non-delayed TU.
      (This is clangd's default configuration on windows: delayed-template-parsing
      is on for the preamble and forced off for the current file)
      
      However today clang fails to parse implicit instantiations in a non-dtp
      TU of templates defined in a dtp PCH file (and presumably module?).
      In this case the delayed parser is not registered, so the function is
      simply marked "delayed" again. We then hit an assert:
      end of TU template instantiation should not create more late-parsed templates
      
      Reviewers: rsmith
      
      Subscribers: ilya-biryukov, usaxena95, cfe-commits, kadircet
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D81474
      05ed3efc
    • Haojian Wu's avatar
      [AST][RecoveryExpr] Build recovery expressions by default for C++. · 58ea1059
      Haojian Wu authored
      Reland https://reviews.llvm.org/D76696
      All known crashes have been fixed, another attemption.
      
      We have rolled out this to all internal users for a while, didn't see
      big issues, we consider it is stable enough.
      
      Reviewed By: sammccall
      
      Subscribers: rsmith, hubert.reinterpretcast, ebevhan, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D78350
      58ea1059
    • Erich Keane's avatar
      (PR46111) Properly handle elaborated types in an implicit deduction guide · 82a21229
      Erich Keane authored
      As reported in PR46111, implicit instantiation of a deduction guide
      causes us to have an elaborated type as the parameter, rather than the
      dependent type.
      
      After review and feedback from @rsmith, this patch solves this problem
      by wrapping the value in an uninstantiated typedef/type-alias that is
      instantiated when required later.
      
      Differential Revision: https://reviews.llvm.org/D80743
      82a21229
    • Kirstóf Umann's avatar
      [analyzer] Introduce weak dependencies to express *preferred* checker callback evaluation order · e22f1c02
      Kirstóf Umann authored
      Checker dependencies were added D54438 to solve a bug where the checker names
      were incorrectly registered, for example, InnerPointerChecker would incorrectly
      emit diagnostics under the name MallocChecker, or vice versa [1]. Since the
      system over the course of about a year matured, our expectations of what a role
      of a dependency and a dependent checker should be crystallized a bit more --
      D77474 and its summary, as well as a variety of patches in the stack
      demonstrates how we try to keep dependencies to play a purely modeling role. In
      fact, D78126 outright forbids diagnostics under a dependency checkers name.
      
      These dependencies ensured the registration order and enabling only when all
      dependencies are satisfied. This was a very "strong" contract however, that
      doesn't fit the dependency added in D79420. As its summary suggests, this
      relation is directly in between diagnostics, not modeling -- we'd prefer a more
      specific warning over a general one.
      
      To support this, I added a new dependency kind, weak dependencies. These are not
      as strict of a contract, they only express a preference in registration order.
      If a weak dependency isn't satisfied, the checker may still be enabled, but if
      it is, checker registration, and transitively, checker callback evaluation order
      is ensured.
      
      If you are not familiar with the TableGen changes, a rather short description
      can be found in the summary of D75360. A lengthier one is in D58065.
      
      [1] https://www.youtube.com/watch?v=eqKeqHRAhQM
      
      Differential Revision: https://reviews.llvm.org/D80905
      e22f1c02
    • Alex Bradbury's avatar
      [CodeGen] Increase applicability of ffine-grained-bitfield-accesses for... · 3dcfd482
      Alex Bradbury authored
      [CodeGen] Increase applicability of ffine-grained-bitfield-accesses for targets with limited native integer widths
      
      As pointed out in PR45708, -ffine-grained-bitfield-accesses doesn't
      trigger in all cases you think it might for RISC-V. The logic in
      CGRecordLowering::accumulateBitFields checks OffsetInRecord is a legal
      integer according to the datalayout. RISC targets will typically only
      have the native width as a legal integer type so this check will fail
      for OffsetInRecord of 8 or 16 when you would expect the transformation
      is still worthwhile.
      
      This patch changes the logic to check for an OffsetInRecord of a at
      least 1 byte, that fits in a legal integer, and is a power of 2. We
      would prefer to query whether native load/store operations are
      available, but I don't believe that is possible.
      
      Differential Revision: https://reviews.llvm.org/D79155
      3dcfd482
    • Akira Hatanaka's avatar
      [CodeGen] Simplify the way lifetime of block captures is extended · c9a52de0
      Akira Hatanaka authored
      Rather than pushing inactive cleanups for the block captures at the
      entry of a full expression and activating them during the creation of
      the block literal, just call pushLifetimeExtendedDestroy to ensure the
      cleanups are popped at the end of the scope enclosing the block
      expression.
      
      rdar://problem/63996471
      
      Differential Revision: https://reviews.llvm.org/D81624
      c9a52de0
    • John McCall's avatar
      Set the LLVM FP optimization flags conservatively. · 7fac1acc
      John McCall authored
      Functions can have local pragmas that override the global settings.
      We set the flags eagerly based on global settings, but if we emit
      an expression under the influence of a pragma, we clear the
      appropriate flags from the function.
      
      In order to avoid doing a ton of redundant work whenever we emit
      an FP expression, configure the IRBuilder to default to global
      settings, and only reconfigure it when we see an FP expression
      that's not using the global settings.
      
      Patch by Michele Scandale!
      
      https://reviews.llvm.org/D80462
      7fac1acc
  2. Jun 11, 2020
    • Bruno Ricci's avatar
      [clang] TextNodeDumper: Dump the trait spelling of {Type,ArrayType,Expression}TraitExpr · a9250c28
      Bruno Ricci authored
      nodes using the new helper functions introduced
      in 78e636b3.
      a9250c28
    • Alexey Bataev's avatar
      [OPENMP50]Codegen for scan directive in simd loops. · 43101d10
      Alexey Bataev authored
      Added codegen for scan directives in simd loop. The codegen transforms
      original code:
      ```
      int x = 0;
       #pragma omp simd reduction(inscan, +: x)
      for (..) {
        <first part>
        #pragma omp scan inclusive(x)
        <second part>
      }
      ```
      into
      ```
      int x = 0;
      for (..) {
        int x_priv = 0;
        <first part>
        x = x_priv + x;
        x_priv = x;
        <second part>
      }
      ```
      and
      ```
      int x = 0;
       #pragma omp simd reduction(inscan, +: x)
      for (..) {
        <first part>
        #pragma omp scan exclusive(x)
        <second part>
      }
      ```
      into
      ```
      int x = 0;
      for (..) {
        int x_priv = 0;
        <second part>
        int temp = x;
        x = x_priv + x;
        x_priv = temp;
        <first part>
      }
      ```
      
      Differential revision: https://reviews.llvm.org/D78232
      43101d10
    • Leonard Chan's avatar
      [clang] Frontend components for the relative vtables ABI (round 2) · 71568a9e
      Leonard Chan authored
      This patch contains all of the clang changes from D72959.
      
      - Generalize the relative vtables ABI such that it can be used by other targets.
      - Add an enum VTableComponentLayout which controls whether components in the
        vtable should be pointers to other structs or relative offsets to those structs.
        Other ABIs can change this enum to restructure how components in the vtable
        are laid out/accessed.
      - Add methods to ConstantInitBuilder for inserting relative offsets to a
        specified position in the aggregate being constructed.
      - Fix failing tests under new PM and ASan and MSan issues.
      
      See D72959 for background info.
      
      Differential Revision: https://reviews.llvm.org/D77592
      71568a9e
    • hyd-dev's avatar
      [PCH] Support writing BuiltinBitCastExprs to PCHs · 95d7ccb7
      hyd-dev authored
      eee944e7 adds the new BuiltinBitCastExpr, but does not set the Code member of
      ASTStmtWriter. This is not correct and causes an assertion failue in
      ASTStmtWriter::emit() when building PCHs that contain __builtin_bit_cast.  This
      commit adds serialization::EXPR_BUILTIN_BIT_CAST and handles
      ASTStmtWriter::Code properly.
      
      Differential revision: https://reviews.llvm.org/D80360
      95d7ccb7
    • Alexey Bataev's avatar
      Revert "[OPENMP50]Codegen for scan directive in simd loops." · fac7259c
      Alexey Bataev authored
      This reverts commit fb80e67f to resolve
      the issue with asan buildbots.
      fac7259c
    • Alexey Bataev's avatar
      [OPENMP50]Codegen for use_device_addr clauses. · 90b54fa0
      Alexey Bataev authored
      Summary:
      Added codegen for use_device_addr clause. The components of the list
      items are mapped as a kind of RETURN components and then the returned
      base address is used instead of the real address of the base declaration
      used in the use_device_addr expressions.
      
      Reviewers: jdoerfert
      
      Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D80730
      90b54fa0
    • Daniel Grumberg's avatar
      Add AST_SIGNATURE record to unhashed control block of PCM files · bb8c7e75
      Daniel Grumberg authored
      Summary:
      This record is constructed by hashing the bytes of the AST block in a similiar
      fashion to the SIGNATURE record. This new signature only means anything if the
      AST block is fully relocatable, i.e. it does not embed absolute offsets within
      the PCM file. This change ensure this does not happen by replacing these offsets
      with offsets relative to the nearest relevant subblock of the AST block.
      
      Reviewers: Bigcheese, dexonsmith
      
      Subscribers: dexonsmith, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D80383
      bb8c7e75
    • Alexey Bataev's avatar
      [OPENMP50]Codegen for scan directive in simd loops. · fb80e67f
      Alexey Bataev authored
      Added codegen for scandirectives in simd loop. The codegen transforms
      original code:
      
      ```
      int x = 0;
       #pragma omp simd reduction(inscan, +: x)
      for (..) {
        <first part>
        #pragma omp scan inclusive(x)
        <second part>
      }
      ```
      into
      ```
      int x = 0;
      for (..) {
        int x_priv = 0;
        <first part>
        x = x_priv + x;
        x_priv = x;
        <second part>
      }
      ```
      and
      ```
      int x = 0;
       #pragma omp simd reduction(inscan, +: x)
      for (..) {
        <first part>
        #pragma omp scan exclusive(x)
        <second part>
      }
      ```
      into
      ```
      int x = 0;
      for (..) {
        int x_priv = 0;
        <second part>
        int temp = x;
        x = x_priv + x;
        x_priv = temp;
        <first part>
      }
      ```
      
      Differential revision: https://reviews.llvm.org/D78232
      fb80e67f
    • Bruno Ricci's avatar
      [clang] Convert a default argument expression to the parameter type... · 40ea01f6
      Bruno Ricci authored
      ...before checking that the default argument is valid with
      CheckDefaultArgumentVisitor.
      
      Currently the restrictions on a default argument are checked with the visitor
      CheckDefaultArgumentVisitor in ActOnParamDefaultArgument before
      performing the conversion to the parameter type in SetParamDefaultArgument.
      
      This was fine before the previous patch but now some valid code post-CWG 2346
      is rejected:
      
      void test() {
        const int i2 = 0;
        extern void h2a(int x = i2);     // FIXME: ok, not odr-use
        extern void h2b(int x = i2 + 0); // ok, not odr-use
      }
      
      This is because the reference to i2 in h2a has not been marked yet with
      NOUR_Constant. i2 is marked NOUR_Constant when the conversion to the parameter
      type is done, which is done just after.
      
      The solution is to do the conversion to the parameter type before checking
      the restrictions on default arguments with CheckDefaultArgumentVisitor.
      This has the side-benefit of improving some diagnostics.
      
      Differential Revision: https://reviews.llvm.org/D81616
      
      Reviewed By: rsmith
      40ea01f6
    • Bruno Ricci's avatar
      [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local... · 5951ff45
      Bruno Ricci authored
      [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local variables in default arguments.
      
      This patch implements the resolution of CWG 2082 and CWG 2346.
      
      The resolution of CWG 2082 changed [dcl.fct.default]p7 and p9 to allow
      a parameter or local variable to appear in a default argument if not
      in a potentially-evaluated expression.
      
      The resolution of CWG 2346 changed [dcl.fct.default]p7 to allow a local
      variable to appear in a default argument if not odr-used.
      
      An issue remains after this patch
      (see the FIXME in test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p7.cpp).
      This is addressed by the next patch.
      
      Differential Revision: https://reviews.llvm.org/D81615
      
      Reviewed By: rsmith, erichkeane
      5951ff45
    • Endre Fülöp's avatar
      [analyzer] On-demand parsing capability for CTU · 5cc18516
      Endre Fülöp authored
      Summary:
      Introduce on-demand parsing of needed ASTs during CTU analysis.
      The index-file format is extended, and analyzer-option CTUInvocationList
      is added to specify the exact invocations needed to parse the needed
      source-files.
      
      Reviewers: martong, balazske, Szelethus, xazax.hun, whisperity
      
      Reviewed By: martong, xazax.hun
      
      Subscribers: gribozavr2, thakis, ASDenysPetrov, ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D75665
      5cc18516
    • Fangrui Song's avatar
      Revert D80450 "[CUDA][HIP] Fix implicit HD function resolution" · dfc0d947
      Fangrui Song authored
      This reverts commit 263390d4.
      
      This can still cause bogus errors:
      
      eigen3/Eigen/src/Core/CoreEvaluators.h:94:38: error: call to implicitly-deleted copy constructor of 'unary_evaluator<Eigen::Inverse<Eigen::Matrix<double, 4, 4, 0, 4, 4>>>'
      
      thrust/system/detail/generic/for_each.h:49:3: error: implicit instantiation of undefined template
      'thrust::detail::STATIC_ASSERTION_FAILURE<false>'
      dfc0d947
  3. Jun 10, 2020
Loading