[all-commits] [llvm/llvm-project] 9e1372: [libc++] Add MSVC's implementation of exception_pt...

Stephan T. Lavavej via All-commits all-commits at lists.llvm.org
Fri Jul 10 11:26:45 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e13720eb81fd8a68fe82ac962c17fd522547464
      https://github.com/llvm/llvm-project/commit/9e13720eb81fd8a68fe82ac962c17fd522547464
  Author: Stephan T. Lavavej <stl at nuwen.net>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M libcxx/CREDITS.TXT
    M libcxx/docs/ReleaseNotes/22.rst
    M libcxx/include/__exception/exception_ptr.h
    M libcxx/src/support/runtime/exception_pointer_msvc.ipp

  Log Message:
  -----------
  [libc++] Add MSVC's implementation of exception_ptr for Windows (#94977)

Microsoft is happy to contribute our implementation of exception_ptr for
Windows, under the Apache License v2.0 with LLVM Exception that our STLs
share.

* excptptr.cpp, copied verbatim as:
https://github.com/microsoft/STL/blob/e36ee6c2b9bc6f5b1f70776c18cf5d3a93a69798/stl/src/excptptr.cpp
* <exception>, copied verbatim as:
https://github.com/microsoft/STL/blob/e36ee6c2b9bc6f5b1f70776c18cf5d3a93a69798/stl/inc/exception

The implementation was integrated into libc++:
* Deleted STL copy of <exception>. All standard exception classes are
  already provided by libc++'s standard headers.
* Replaced MSVC STL naming conventions and macros (_STD,
  _CRTIMP2_PURE, _Ref_count_base, _Ptr_base, _EXCEPTION_RECORD, etc.)
  with standard libc++ style and identifiers (_LIBCPP_EXPORTED_FROM_ABI,
  __double_leading_underscore variable/function names).
* Replaced internal MSVC CRT headers (<trnsctrl.h>,
  <internal_shared.h>, <xcall_once.h>) with portable standard C++
  constructs (e.g., standard C++ function-local static initialization
  for immortal static exception objects) and inline pointer-to-member
  invocation helpers.
* Removed all exported __ExceptionPtr... C functions. These symbols
  were originally present in Microsoft's CRT DLL exports solely to
  support inline methods in MSVC STL's <exception> header.
* Moved all SEH/EH exception record definitions, SEH copying helpers
  (__populate_cpp_exception_record, __copy_exception_object), and
  reference-counted control blocks (__exception_ptr_static and
  __exception_ptr_normal) directly into exception_pointer_msvc.ipp.
* Use reference-counted control block representation on Windows which
  removed the platform #ifdef _LIBCPP_ABI_MICROSOFT bifurcation for
  class exception_ptr in exception_ptr.h. std::exception_ptr now uses
  the same layout across all operating systems.

Co-authored-by: Petr Hosek <phosek at google.com>



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