1. Jun 13, 2024
    • Peter Klausler's avatar
      [flang] Disable Fortran free form line continuation in non-source lin… (#94663) · e286ecfe
      Peter Klausler authored
      …e produced by keyword macro replacement
      
      When later initial keyword macro replacement will yield a line that is
      not Fortran source, don't interpret "&" as a Fortran source line
      continuation marker during tokenization of the line.
      
      Fixes https://github.com/llvm/llvm-project/issues/82579.
      e286ecfe
    • Ramkumar Ramachandra's avatar
      Reland "mlir/Presburger/MPInt: move into llvm/ADT" (#95254) · 1a0e67d7
      Ramkumar Ramachandra authored
      Change: remove guards on debug-printing, to allow Release builds without
      LLVM_ENABLE_DUMP to pass.
      
      MPInt is an arbitrary-precision integer library that builds on top of
      APInt, and has a fast-path when the number fits within 64 bits. It was
      originally written for the Presburger library in MLIR, but seems useful
      to the LLVM project in general, independently of the Presburger library
      or MLIR. Hence, move it into LLVM/ADT under the name DynamicAPInt.
      
      This patch is part of a project to move the Presburger library into
      LLVM.
      1a0e67d7
    • Mark de Wever's avatar
      [libc++][modules] Mark as implemented. (#90091) · 759fb590
      Mark de Wever authored
      The feature has been implemented in LLVM 18 as an experimental feature.
      This marks the paper as complete and sets the feature-test macro.
      
      Implements
      - P2465R3 Standard Library Modules std and std.compat
      
      Fixes: https://github.com/llvm/llvm-project/issues/89579
      759fb590
    • Mark de Wever's avatar
      [libc++] Adds __cpp_lib_three_way_comparison FTM. (#91515) · c36961bd
      Mark de Wever authored
      The paper
        P0768R1 Library Support for the Spaceship (Comparison) Operator
      did not add a feature-test macro. This omission has been corrected in
        P1353R0 Missing Feature Test Macros
      
      This enables the FTM for P0768R1
      
      Fixes: https://github.com/llvm/llvm-project/issues/73953
      
      
      
      ---------
      
      Co-authored-by: default avatarS. B. Tam <cpplearner@outlook.com>
      c36961bd
    • Michael Jones's avatar
      [libc] Add baremetal putchar (#95182) · 9a1611f9
      Michael Jones authored
      In #94685 I discussed my ideas for cleaner baremetal output writing.
      This patch is not that. This patch just uses `write_to_stderr` for
      outputting from putchar and printf on baremetal. I'm still planning to
      create a proper design for writing to stdout and stderr on various
      platforms, but that will be a followup patch.
      9a1611f9
    • LLVM GN Syncbot's avatar
      [gn build] Port 9540950a · 90a154e0
      LLVM GN Syncbot authored
      90a154e0
    • Felipe de Azevedo Piovezan's avatar
      [lldb] Fix linker flags in lldb tests · c5790206
      Felipe de Azevedo Piovezan authored
      This is a fixup to https://github.com/llvm/llvm-project/pull/93808,
      which used LDFLAGS instead of the correct LD_EXTRAS
      c5790206
    • Louis Dionne's avatar
      fe4cd104
    • Louis Dionne's avatar
    • Louis Dionne's avatar
      [libc++] Overhaul the PSTL dispatching mechanism (#88131) · 9540950a
      Louis Dionne authored
      The experimental PSTL's current dispatching mechanism was designed with
      flexibility in mind. However, while reviewing the in-progress OpenMP
      backend, I realized that the dispatching mechanism based on ADL and
      default definitions in the frontend had several downsides. To name a
      few:
      
      1. The dispatching of an algorithm to the back-end and its default
         implementation is bundled together via `_LIBCPP_PSTL_CUSTOMIZATION_POINT`.
         This makes the dispatching really confusing and leads to annoyances
         such as variable shadowing and weird lambda captures in the front-end.
      2. The distinction between back-end functions and front-end algorithms
         is not as clear as it could be, which led us to call one where we meant
         the other in a few cases. This is bad due to the exception requirements
         of the PSTL: calling a front-end algorithm inside the implementation of
         a back-end is incorrect for exception-safety.
      3. There are two levels of back-end dispatching in the PSTL, which treat
         CPU backends as a special case. This was confusing and not as flexible
         as we'd like. For example, there was no straightforward way to dispatch
         all uses of `unseq` to a specific back-end from the OpenMP backend,
         or for CPU backends to fall back on each other.
      
      This patch rewrites the backend dispatching mechanism to solve these
      problems, but doesn't touch any of the actual implementation of
      algorithms. Specifically, this rewrite has the following
      characteristics:
      
      - There is a single level of backend dispatching, however partial backends can
        be stacked to provide a full implementation of the PSTL. The two-level dispatching
        that was used for CPU-based backends is handled by providing CPU-based basis 
        operations as simple helpers that can easily be reused when defining any PSTL 
        backend.
      
      - The default definitions for algorithms are separated from their dispatching logic.
      
      - The front-end is thus simplified a whole lot and made very consistent
        for all algorithms, which makes it easier to audit the front-end for
        things like exception-correctness, appropriate forwarding, etc.
      
      Fixes #70718
      9540950a
    • Rodrigo Salazar's avatar
      [libcxx] Correct and clean-up filesystem operations error_code paths (#88341) · 11399028
      Rodrigo Salazar authored
      3 error_code related cleanups/corrections in the std::filesystem
      operations functions.
      
      1. In `__copy`, the `ec->clear()` is unnecessary as `ErrorHandler` at
      the start of each function clears the error_code as part of its
      initialization.
      
      2. In `__copy`, in the recursive codepath we are not checking the
      error_code result of `it.increment(m_ec2)` immediately after use in the
      for loop condition (and we aren't checking it after the final increment
      when we don't enter the loop).
      
      3. In `__weakly_canonical`, it makes calls to `__canonical` (which
      internally uses OS APIs implementing POSIX `realpath`) and we are not
      checking the error code result from the `__canonical` call. Both
      `weakly_canonical` and `canonical` are supposed to set the error_code
      when underlying OS APIs result in an error
      (https://eel.is/c++draft/fs.err.report#3.1). With this change we
      propagate up the error_code from `__canonical` caused by any underlying
      OS API failure up to the `__weakly_canonical`. Essentially, if
      `__canonical` thinks an error code should be set, then
      `__weakly_canonical` must as well. Before this change it would be
      throwing an exception in the non-error_code form of the function when
      `__canonical` fails, while not setting the error code in the error_code
      form of the function (an inconsistency).
      
      Added a little coverage in weakly_canonical.pass.cpp for the error_code
      forms of the API that was missing. Though I am lacking utilities in
      libcxx testing to add granular testing of the failure scenarios (like
      forcing realpath to fail for a given path, as it could if you had
      something like a flaky remote filesystem).
      11399028
    • Martin Storsjö's avatar
      [libcxx] [ci] Update Clang for Windows jobs to 18.1.x (#95228) · bce24987
      Martin Storsjö authored
      Pick the latest version available in Chocolatey (18.1.6) and llvm-mingw
      (20240606, which includes LLVM 18.1.7).
      
      Also add the flag "--allow-downgrade" when installing a specific version
      of LLVM. If the preinstalled version is higher than the requested one,
      Chocolatey would otherwise error out when requesting installing a lower
      version. This will avoid errors in the future, if the runner image comes
      preinstalled with a newer version of LLVM.
      
      (This currently seems to happen with a recent version of the GitHub
      Actions runner image, version 20240610.1.0 has LLVM 18.1.6 already
      preinstalled, and will error out when trying to install the 17.0.6
      version that we previously requested.)
      bce24987
    • Simon Pilgrim's avatar
      1216e704
  2. Jun 12, 2024