diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-10-17 18:43:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-10-17 18:43:40 +0000 |
commit | 63a4ea185965b3278fb07b7b865910eb18ee83ad (patch) | |
tree | d4469cba160af830b117b8b8075ed7197f613e03 /llvm/lib/VMCore/Function.cpp | |
parent | 975bfc9b45ef7384a4d744fb5f7fdf61325001bf (diff) | |
download | bcm5719-llvm-63a4ea185965b3278fb07b7b865910eb18ee83ad.tar.gz bcm5719-llvm-63a4ea185965b3278fb07b7b865910eb18ee83ad.zip |
Correct over-zealous removal of hack.
Some code want to check that *any* call within a function has the 'returns
twice' attribute, not just that the current function has one.
llvm-svn: 142221
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r-- | llvm/lib/VMCore/Function.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index 975ec83b4df..a6128b0cad7 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -411,4 +411,19 @@ bool Function::hasAddressTaken(const User* *PutOffender) const { return false; } +/// callsFunctionThatReturnsTwice - Return true if the function has a call to +/// setjmp or other function that gcc recognizes as "returning twice". +bool Function::callsFunctionThatReturnsTwice() const { + for (const_inst_iterator + I = inst_begin(this), E = inst_end(this); I != E; ++I) { + const CallInst* callInst = dyn_cast<CallInst>(&*I); + if (!callInst) + continue; + if (callInst->canReturnTwice()) + return true; + } + + return false; +} + // vim: sw=2 ai |