[all-commits] [llvm/llvm-project] f3bc0e: [libc++] Bypass calling exception-throwing functio...

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Aug 20 05:39:46 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3bc0e51ab72f504445228cbb712542154ccb4cf
      https://github.com/llvm/llvm-project/commit/f3bc0e51ab72f504445228cbb712542154ccb4cf
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2021-08-20 (Fri, 20 Aug 2021)

  Changed paths:
    M libcxx/include/string
    M libcxx/include/vector

  Log Message:
  -----------
  [libc++] Bypass calling exception-throwing functions in the dylib with -fno-exceptions

basic_string and vector currently have a hard dependency on the compiled
library because they need to call __vector_base_common::__throw_xxx(),
which are externally instantiated in the compiled library. That makes
sense when exceptions are enabled (because we're trying to localize the
exception-throwing code to the compiled library), but it doesn't really
make sense when exceptions are disabled, and the __throw_xxx functions
are just calling abort() anyways.

This patch simply overrides the __throw_xxx() functions so that they
don't rely on the compiled library when exceptions are disabled.

Differential Revision: https://reviews.llvm.org/D108389




More information about the All-commits mailing list