1. Jun 05, 2024
    • Fangrui Song's avatar
      [𝘀𝗽𝗿] initial version · 198b69d3
      Fangrui Song authored
      Created using spr 1.3.5-bogner
      198b69d3
    • Louis Dionne's avatar
      [libc++] Properly detect whether C++20 modules are supported by the compiler (#94275) · b9915ad4
      Louis Dionne authored
      It is possible for a compiler to support the warning without being able
      to compile `export module foo;`, so use that in addition to the warning
      to check whether C++20 modules are supported.
      b9915ad4
    • Logikable's avatar
      [compiler-rt][builtins] Switch libatomic locks to pthread_mutex_t (#94374) · b62b7a42
      Logikable authored
      When an uninstrumented libatomic is used with a TSan instrumented
      memcpy, TSan may report a data race in circumstances where writes are
      arguably safe.
      
      This occurs because __atomic_compare_exchange won't be instrumented in
      an uninstrumented libatomic, so TSan doesn't know that the subsequent
      memcpy is race-free.
      
      On the other hand, pthread_mutex_(un)lock will be intercepted by TSan,
      meaning an uninstrumented libatomic will not report this false-positive.
      
      pthread_mutexes also may try a number of different strategies to acquire
      the lock, which may bound the amount of time a thread has to wait for a
      lock during contention.
      
      While pthread_mutex_lock has a larger overhead (due to the function
      call and some dispatching), a dispatch to libatomic already predicates
      a lack of performance guarantees.
      b62b7a42
    • Valentin Clement (バレンタイン クレメン)'s avatar
      [flang] Carry over alignment computed by frontend for COMMON (#94280) · c1654c38
      The frontend computes the necessary alignment for COMMON blocks but this
      information is never carried over to the code generation and can lead to
      segfault for COMMON block that requires a non default alignment.
      
      This patch add an optional attribute on fir.global and carries over the
      information.
      c1654c38
    • Sayhaan Siddiqui's avatar
      [BOLT][DWARF][NFC] Add split-dwarf5 test with multiple CUs (#93744) · 7103e60f
      Sayhaan Siddiqui authored
      Adds a split-dwarf test for DWARF5 with multiple CUs.
      7103e60f
    • Aaron Ballman's avatar
      Disable constexpr function body checking in more situations (#94347) · e5f7123d
      Aaron Ballman authored
      Before C++23, we would check a constexpr function body to diagnose if
      the function can never be evaluated in a constant expression context.
      This was previously required standards behavior, but C++23 relaxed the
      restrictions with P2448R2. While this checking is useful, it is also
      quite expensive, especially in pathological cases (see #92924 for an
      example), because it means the mere presence of a constexpr function
      definition will require constant evaluation even if the function is not
      used within the TU.
      
      Clang suppresses diagnostics in system headers by default and system
      headers (like STL implementations) can be full of constexpr function
      bodies. Now we suppress the check for a diagnostic if the function
      definition is in a system header or if the `-Winvalid-constexpr`
      diagnostic is disabled. This should have some mild compile time
      performance improvements.
      
      Also, the previous implementation would disable the diagnostic in C++23
      mode entirely. Due to the benefit of the check, this patch now makes it
      possible to enable the diagnostic explicitly in C++23 mode.
      e5f7123d
    • Jonas Devlieghere's avatar
      [lldb] Support reading DW_OP_piece from file address (#94026) · 7dc84e22
      Jonas Devlieghere authored
      We received a bug report where someone was trying to print a global
      variable without a process. This would succeed in a debug build but fail
      in a on optimized build. We traced the issue back to the location being
      described by a DW_OP_addr + DW_OP_piece.
      
      The issue is that the DWARF expression evaluator only support reading
      pieces from a load address. There's no reason it cannot do the same for
      a file address, and indeed, that solves the problem.
      
      I unsuccessfully tried to craft a test case to illustrate the original
      example, using a global struct and trying to trick the compiler into
      breaking it apart with SROA. Instead I wrote a unit test that uses a
      mock target to read memory from.
      
      rdar://127435923
      7dc84e22
    • Brendan Dahl's avatar
    • Miguel A. Arroyo's avatar
      [llvm-readobj][COFF] Consistent PDBGUID Formatting (#94256) · 0cb66a7b
      Miguel A. Arroyo authored
      ## Consistent PDB GUID in `llvm-readobj`
      
      Currently, the PDB GUID is shown as a byte array:
      `PDBGUID: (D8 4C 88 D9 26 15 1F 11 4C 4C 44 20 50 44 42 2E)`
      
      This is inconsistent with `llvm-pdbutil` (e.g. `llvm-pdbutil dump
      --summary`) which shows it as a hexadecimal string.
      Additionally, `yaml2obj` uses the same hexadecimal string format.
      
      In general, the hexadecimal string is the common representation for PDB
      GUIDs on Windows.
      
      This PR changes it to be consistent as shown below:
      `PDBGUID: {D9884CD8-1526-111F-4C4C-44205044422E}`
      0cb66a7b
    • Jay Foad's avatar
    • Eli Friedman's avatar
      [Sema] Fix handling of fields with initializers in nested anonymous unions. (#91692) · 5ae5774f
      Eli Friedman authored
      Make sure we count the anonymous union as an initialized field, so we
      properly construct the AST.
      
      Included bonus testcase Test3, which shows a remaining gap: an anonymous
      union can contain a partially initialized anonymous struct, and we
      handle that inconsistently.
      
      Fixes #91257
      5ae5774f
    • Jay Foad's avatar
      [AMDGPU] Do not override PseudoInstr in FLAT Pseudo definitions. NFC. (#94369) · 8e94f0a0
      Jay Foad authored
      Simplify by setting PseudoInstr to the tablegen name of the Pseudo in
      the first place.
      8e94f0a0
    • Artem Chikin's avatar
      [clang][deps] Collect discovered module dependencies' Link Libraries (#93588) · 68eb3b20
      Artem Chikin authored
      This will allow scanner clients to be able to compute e.g. auto-linking
      dependencies of the scanned translation unit.
      68eb3b20
    • Fangrui Song's avatar
      [ELF] Orphan placement: prefer the last similar section when its rank <= orphan's rank · 7b346357
      Fangrui Song authored
      `findOrphanPos` finds the most similar output section (that has input
      sections). In the event of proximity ties, we select the first section.
      
      However, when an orphan section's rank is equal to or larger than the
      most similar sections's, it makes sense to prioritize the last similar
      section. This new behavior matches GNU ld better.
      
      ```
      // orphan placement for .bss (SHF_ALLOC|SHF_WRITE, SHT_NOBITS)
      
      WA SHT_PROGBITS
      (old behavior) <= here
      A
      WA SHT_PROGBITS
      AX
      WA (.data)
      (new behavior) <= here
      ```
      
      When the orphan section's rank is less, the current behavior
      prioritizing the first section still makes sense.
      ```
      // orphan with a smaller rank, e.g. .rodata
      
      <= here
      WA
      AX
      WA
      ```
      
      Close #92987
      
      Pull Request: https://github.com/llvm/llvm-project/pull/94099
      7b346357
    • Leandro Lupori's avatar
      [flang] Escape '%' in %VAL/%REF messages (#94331) · 6ac5047a
      Leandro Lupori authored
      flang/test/Semantics/call40.f90 was failing on Darwin:
      actual at 27: VAL or REF are not allowed for dummy argument 'a='
        that must be passed by means of a descriptor
      expect at 27: %VAL or %REF are not allowed for dummy argument 'a='
        that must be passed by means of a descriptor
      
      When messages.Say() is called with more arguments than just the
      fixed text message, the message is treated as a format string,
      passed to vsnprintf. Therefore, the '%' chars in it must be
      escaped.
      
      Note that no conversion happens when there is only a fixed text
      message. Escaping '%' in this case causes "%%" to be outputted.
      This can be confusing for someone expecting printf-like behavior.
      Processing these text messages with snprintf could solve this,
      as a future improvement.
      6ac5047a
  2. Jun 04, 2024