Add an option to disable tail-call optimization for escaping blocks.
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 2 Mar 2018 01:53:15 +0000 (01:53 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 2 Mar 2018 01:53:15 +0000 (01:53 +0000)
commit627586b8508e5f0675eb55dcbb5133bde4b8ad3c
treee51428049104f8757201deb2e6604d923f5d070c
parent7d0f5ab6aa061ebe04208fd6fc90ba5cf4815514
Add an option to disable tail-call optimization for escaping blocks.

This makes it easier to debug crashes and hangs in block functions since
users can easily find out where the block is called from. The option
doesn't disable tail-calls from non-escaping blocks since non-escaping
blocks are not as hard to debug as escaping blocks.

rdar://problem/35758207

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

llvm-svn: 326530
clang/include/clang/AST/Decl.h
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/CodeGen/CGCall.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprObjC.cpp
clang/lib/Sema/SemaPseudoObject.cpp
clang/test/CodeGenObjC/disable-tail-call-escaping-block.m [new file with mode: 0644]
clang/test/Driver/fno-escaping-block-tail-calls.c [new file with mode: 0644]