diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-10-17 18:22:52 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-10-17 18:22:52 +0000 |
commit | 728662f9e869251ff9b5a847b0cb0daa99d1d250 (patch) | |
tree | 585f6c4f263ad1cfd11ab701476fc8e77764b8c6 /lib/VMCore/Function.cpp | |
parent | f1fddcd9e01ceb38ee7f2951f9e109cccb601654 (diff) |
Now that we have the ReturnsTwice function attribute, this method is
obsolete. Check the attribute instead.
<rdar://problem/8031714>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r-- | lib/VMCore/Function.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 1215e6a57c..975ec83b4d 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -411,44 +411,4 @@ 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". -/// -/// FIXME: Remove after <rdar://problem/8031714> is fixed. -/// FIXME: Is the above FIXME valid? -bool Function::callsFunctionThatReturnsTwice() const { - static const char *const ReturnsTwiceFns[] = { - "_setjmp", - "setjmp", - "sigsetjmp", - "setjmp_syscall", - "savectx", - "qsetjmp", - "vfork", - "getcontext" - }; - - 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; - - // check for known function names. - // FIXME: move this to clang. - Function *F = callInst->getCalledFunction(); - if (!F) - continue; - StringRef Name = F->getName(); - for (unsigned J = 0, e = array_lengthof(ReturnsTwiceFns); J != e; ++J) { - if (Name == ReturnsTwiceFns[J]) - return true; - } - } - - return false; -} - // vim: sw=2 ai |