]> granicus.if.org Git - clang/commit
[Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 3 Aug 2017 23:55:42 +0000 (23:55 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 3 Aug 2017 23:55:42 +0000 (23:55 +0000)
commit469977f45cc099675015ebeafa4b98b969f8b70b
tree8b49a1a3029aef94c83fdcaff5344c506e4ff40a
parenta00fc3d03e4bfcb332d51e6edf5dd48372db8d52
[Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.

This commit fixes a bug where clang/llvm doesn't emit an unwind table
for a function when it is marked noexcept. Without this patch, the
following code terminates with an uncaught exception on ARM64:

int foo1() noexcept {
  try {
    throw 0;
  } catch (int i) {
    return 0;
  }
  return 1;
}

int main() {
  return foo1();
}

rdar://problem/32411865

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310006 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/Driver/ToolChain.h
lib/Driver/ToolChain.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Driver/ToolChains/CrossWindows.cpp
lib/Driver/ToolChains/CrossWindows.h
lib/Driver/ToolChains/Darwin.cpp
lib/Driver/ToolChains/Darwin.h
lib/Driver/ToolChains/Gnu.cpp
lib/Driver/ToolChains/Gnu.h
lib/Driver/ToolChains/MSVC.cpp
lib/Driver/ToolChains/MSVC.h
lib/Driver/ToolChains/MinGW.cpp
lib/Driver/ToolChains/MinGW.h
lib/Driver/ToolChains/NetBSD.h
test/Driver/clang-translation.c