1. Jun 08, 2024
  2. Jun 07, 2024
    • jeanPerier's avatar
      [flang][runtime] add SHAPE runtime interface (#94702) · b01ac513
      jeanPerier authored
      Add SHAPE runtime API (will be used for assumed-rank, lowering is
      generating other cases inline).
      
      I tried to make it in a way were there is no dynamic allocation in the
      runtime/deallocation expected to be inserted by inline code for arrays
      that we know are small (lowering will just always stack allocate a rank
      15 array to avoid dynamic stack allocation or heap allocation).
      b01ac513
    • Simon Pilgrim's avatar
      [Reassociate] shifttest.ll - generate test checks to replace custom grep expression · 97b12df2
      Simon Pilgrim authored
      (and remove an unused argument)
      97b12df2
    • Nico Weber's avatar
      [libc++] Undeprecate shared_ptr atomic access APIs (#92920) · 716ed5fc
      Nico Weber authored
      This patch reverts 9b832b72 (#87111):
      - [libc++] Deprecated `shared_ptr` Atomic Access APIs as per P0718R2
      - [libc++] Implemented P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs from C++26
      
      As explained in [1], the suggested replacement in P2869R3 is `__cpp_lib_atomic_shared_ptr`,
      which libc++ does not yet implement. Let's not deprecate the old way of doing things before
      the new way of doing things exists.
      
      [1]: https://github.com/llvm/llvm-project/pull/87111#issuecomment-2112740039
      716ed5fc
    • Vy Nguyen's avatar
      Reapply PR/87550 (#94625) · 35fa2ded
      Vy Nguyen authored
      Re-apply https://github.com/llvm/llvm-project/pull/87550 with fixes.
      
      Details:
      Some tests in fuchsia failed because of the newly added assertion.
      This was because `GetExceptionBreakpoint()` could be called before
      `g_dap.debugger` was initted.
      
      The fix here is to just lazily populate the list in
      GetExceptionBreakpoint() rather than assuming it's already been initted.
      (There is some nuisance here because we can't simply just populate it in
      DAP::DAP(), which is a global ctor and is called before
      `SBDebugger::Initialize()` is called. )
      35fa2ded
    • Konstantin Varlamov's avatar
      [libc++][regex] Correctly adjust match prefix for zero-length matches. (#94550) · e9adcc48
      Konstantin Varlamov authored
      For regex patterns that produce zero-length matches, there is one
      (imaginary) match in-between every character in the sequence being
      searched (as well as before the first character and after the last
      character). It's easiest to demonstrate using replacement:
      `std::regex_replace("abc"s, "!", "")` should produce `!a!b!c!`, where
      each exclamation mark makes a zero-length match visible.
      
      Currently our implementation doesn't correctly set the prefix of each
      zero-length match, "swallowing" the characters separating the imaginary
      matches -- e.g. when going through zero-length matches within `abc`, the
      corresponding prefixes should be `{'', 'a', 'b', 'c'}`, but before this
      patch they will all be empty (`{'', '', '', ''}`). This happens in the
      implementation of `regex_iterator::operator++`. Note that the Standard
      spells out quite explicitly that the prefix might need to be adjusted
      when dealing with zero-length matches in
      [`re.regiter.incr`](http://eel.is/c++draft/re.regiter.incr):
      > In all cases in which the call to `regex_search` returns `true`,
      `match.prefix().first` shall be equal to the previous value of
      `match[0].second`... It is unspecified how the implementation makes
      these adjustments.
      
      [Reproduction example](https://godbolt.org/z/8ve6G3dav)
      ```cpp
      #include <iostream>
      #include <regex>
      #include <string>
      
      int main() {
        std::string str = "abc";
        std::regex empty_matching_pattern("");
      
        { // The underlying problem is that `regex_iterator::operator++` doesn't update
          // the prefix correctly.
          std::sregex_iterator i(str.begin(), str.end(), empty_matching_pattern), e;
          std::cout << "\"";
          for (; i != e; ++i) {
            const std::ssub_match& prefix = i->prefix();
            std::cout << prefix.str();
          }
          std::cout << "\"\n";
          // Before the patch: ""
          // After the patch: "abc"
        }
      
        { // `regex_replace` makes the problem very visible.
          std::string replaced = std::regex_replace(str, empty_matching_pattern, "!");
          std::cout << "\"" << replaced << "\"\n";
          // Before the patch: "!!!!"
          // After the patch: "!a!b!c!"
        }
      }
      ```
      
      Fixes #64451
      
      rdar://119912002
      e9adcc48