[inliner] Fix PR18206 by preventing inlining functions that call setjmp
authorChandler Carruth <chandlerc@gmail.com>
Fri, 13 Dec 2013 08:00:01 +0000 (08:00 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 13 Dec 2013 08:00:01 +0000 (08:00 +0000)
commita7e2ef7e6ebb1da7dd75141a38a8c9c5fda292d2
tree37ee808b92b638c0da9ef8f2a2aba6552cd14c73
parent0bdc7cd5de8b11564ce7ab3af584b11a48b7ab51
[inliner] Fix PR18206 by preventing inlining functions that call setjmp
through an invoke instruction.

The original patch for this was written by Mark Seaborn, but I've
reworked his test case into the existing returns_twice test case and
implemented the fix by the prior refactoring to actually run the cost
analysis over invoke instructions, and then here fixing our detection of
the returns_twice attribute to work for both calls and invokes. We never
noticed because we never saw an invoke. =[

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197216 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/IPA/InlineCost.cpp
test/Transforms/Inline/inline_returns_twice.ll