1. Oct 05, 2022
    • Sanjay Patel's avatar
      b2041494
    • Fangrui Song's avatar
      [llvm-objdump] Add --no-addresses as an alias for --no-leading-addr · 5c7566cd
      Fangrui Song authored
      The output is similar to objdump --no-addresses since binutils 2.35.
      
      Depends on D135039
      Close #58088
      
      Differential Revision: https://reviews.llvm.org/D135040
      5c7566cd
    • Fangrui Song's avatar
      [llvm-objdump] --no-leading-addr: hide inline relocation offsets · ad92a3db
      Fangrui Song authored
      It seems to make sense to omit offsets when --no-leading-addr is specified. The output is now closer
      to objdump -dr --no-addresses (non-wide output).
      
      Reviewed By: nickdesaulniers
      
      Differential Revision: https://reviews.llvm.org/D135039
      ad92a3db
    • Nathaniel McVicar's avatar
      [mlir][sparse] Restore case coverage warning fix · 83839700
      Nathaniel McVicar authored
      This restores the fix from D134925 to make MSVC and clang happy.
      
      Reviewed By: stella.stamenova
      
      Differential Revision: https://reviews.llvm.org/D135126
      83839700
    • Mark de Wever's avatar
      [libc++][format] Updates to Unicode 15. · deaad6a1
      Mark de Wever authored
      This adds support for the new code points in the Extended Grapheme
      Cluster algorithm. The algorithm itself has remained unchanged.
      
      The width estimation still follows the rules of the Standard.
      @cor3ntin filed
        LWG3780 format's width estimation is too approximate and not forward compatible
      to improve the estimate.
      
      Reviewed By: ldionne, #libc
      
      Differential Revision: https://reviews.llvm.org/D134106
      deaad6a1
    • Daniel Rodríguez Troitiño's avatar
      [ObjectYAML] Support for basic data in code. · 86bf43d2
      Daniel Rodríguez Troitiño authored
      This is a split of D134250.
      
      Supports for parsing and dumping the LC_DATA_IN_CODE contents (as binary
      data).
      
      This allows more complete testing of llvm-objdump in D133974.
      
      Reviewed By: Higuoxing
      
      Differential Revision: https://reviews.llvm.org/D134569
      86bf43d2
    • Craig Topper's avatar
      [RISCV] Refactor and improve eliminateFrameIndex. · a38fb90b
      Craig Topper authored
      There are few changes mixed in here.
      
      -Try to reuse the destination register from ADDI instead of always
      creating a virtual register. This way we lean on the register
      scavenger in fewer case.
      -Explicitly reuse the primary virtual register when possible. There's
      still a case where both getVLENFactoredAmount and handling large
      fixed offsets can both create a secondary virtual register.
      -Combine similar BuildMI calls by manipulating the Register variables.
      
      There are still a couple early outs for ADDI, but overall I tried to
      arrange the code into steps.
      
      Reviewed By: reames
      
      Differential Revision: https://reviews.llvm.org/D135009
      a38fb90b
    • Craig Topper's avatar
      [RISCV] Restructure eliminateFrameIndex to share more code. NFC · 2734968e
      Craig Topper authored
      The old code took two different paths based on whether there is
      a scalable offset, but these two paths had some code in common.
      
      The main difference between the two code paths was whether we needed
      to create a GPR or not for the ADDI that gets created for RVVSpill.
      If we had a scalable offset, the same GPR was used as the destination
      for adding the scalable offset and the ADDI. To manage this, we now
      cache the scratch register and reuse it if it has already been created.
      
      This is a pre-patch for D135009.
      
      Reviewed By: reames, frasercrmck
      
      Differential Revision: https://reviews.llvm.org/D135092
      2734968e
    • Nicolas Vasilache's avatar
    • Daniel Rodríguez Troitiño's avatar
      [ObjectYAML][MachO] Encode export trie address as ULEB128, not as SLEB128 · 57bd11f0
      Daniel Rodríguez Troitiño authored
      The `dumpExportEntry` was dumping everything using signed LEB128, but
      the format seems to use unsigned LEB128. This can be cross-checked with
      the implementation in MachOObjectFile.cpp, the implementation in LLD's
      ExportTrie.cpp, and the implementation in macho2yaml.cpp, which all use
      ULEB128 functions..
      
      The difference is only apparent when encoding some values with specific
      bit patterns (bit active in the 7th, 14th, ... bits of the binary). The
      encoding was not always creating problems in the resulting binaries
      because if the extra byte was part of the padding, the result of
      decoding it as ULEB128 is the same as decoding as SLEB128, however, the
      code of MachOObjectFile.cpp (used by llvm-objdump) checks the buffer
      decoding position against the reported length, which triggered an error.
      
      Modified a test that used an address with this pattern (0x3FA0, the 14th
      bit is active), to show that a round trip still produces the same
      results, and added a check using llvm-objdump to use their extra checks
      to verify this implementation.
      
      Reviewed By: pete
      
      Differential Revision: https://reviews.llvm.org/D134563
      57bd11f0
    • Nicolas Vasilache's avatar
    • Aaron Ballman's avatar
      Modify the qualified/unqualified getter for TypeOfType; NFC · 42ad305b
      Aaron Ballman authored
      Post-commit feedback observed that returning the TypeOfKind from the
      type instead of a Boolean cleans up code using that interface.
      42ad305b
    • Tom Honermann's avatar
      [clang] Correct handling of lambdas in lambda default arguments in dependent contexts. · 4409a83c
      Tom Honermann authored
      Previously, a lambda expression in a dependent context with a default argument
      containing an immediately invoked lambda expression would produce a closure
      class object that, if invoked such that the default argument was used, resulted
      in a compiler crash or one of the following assertion failures during code
      generation. The failures occurred regardless of whether the lambda expressions
      were dependent.
      
        clang/lib/CodeGen/CGCall.cpp:
        Assertion `(isGenericMethod || Ty->isVariablyModifiedType() || Ty.getNonReferenceType()->isObjCRetainableType() || getContext() .getCanonicalType(Ty.getNonReferenceType()) .getTypePtr() == getContext().getCanonicalType((*Arg)->getType()).getTypePtr()) && "type mismatch in call argument!"' failed.
      
        clang/lib/AST/Decl.cpp:
        Assertion `!Init->isValueDependent()' failed.
      
      Default arguments in declarations in local context are instantiated along with
      their enclosing function or variable template (since such declarations can't
      be explicitly specialized). Previously, such instantiations were performed at
      the same time that their associated parameters were instantiated. However, that
      approach fails in cases like the following in which the context for the inner
      lambda is the outer lambda, but construction of the outer lambda is dependent
      on the parameters of the inner lambda. This change resolves this dependency by
      delyaing instantiation of default arguments in local contexts until after
      construction of the enclosing context.
        template <typename T>
        auto f() {
          return [](T = []{ return T{}; }()) { return 0; };
        }
      
      Refactoring included with this change results in the same code now being used
      to instantiate default arguments that appear in local context and those that
      are only instantiated when used at a call site; previously, such code was
      duplicated and out of sync.
      
      Fixes https://github.com/llvm/llvm-project/issues/49178
      
      Reviewed By: erichkeane
      
      Differential Revision: https://reviews.llvm.org/D133500
      4409a83c
  2. Oct 04, 2022