[all-commits] [llvm/llvm-project] d873af: [libc++] Optimize string copy construction (#222021)

Nikolas Klauser via All-commits all-commits at lists.llvm.org
Mon Sep 14 03:22:19 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d873afedebd0726700ba7f42a5d6e54dba288557
      https://github.com/llvm/llvm-project/commit/d873afedebd0726700ba7f42a5d6e54dba288557
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__assert
    A libcxx/include/__utility/assume.h
    M libcxx/include/module.modulemap.in
    M libcxx/include/string
    M libcxx/test/libcxx/assertions/single_expression.pass.cpp

  Log Message:
  -----------
  [libc++] Optimize string copy construction (#222021)

We know that the string size provided to `__init_copy_ctor_external` is
less than or equal to `max_size()`, so we don't need to do that check
again. Removing that check allows the compiler to ShrinkWrap the small
size path and also removes some unnecessary work in the allocating path.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list