summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-10-17 18:22:52 +0000
committerBill Wendling <isanbard@gmail.com>2011-10-17 18:22:52 +0000
commit2a83a71c2a8e296ea803b50882d30b1794cb3e0e (patch)
tree96b7b676d123da2f2056b3bf78aa733a288927fe /llvm/lib/VMCore/Function.cpp
parent0317b65367563749d277ca31b6d464fc5f1d68c6 (diff)
downloadbcm5719-llvm-2a83a71c2a8e296ea803b50882d30b1794cb3e0e.tar.gz
bcm5719-llvm-2a83a71c2a8e296ea803b50882d30b1794cb3e0e.zip
Now that we have the ReturnsTwice function attribute, this method is
obsolete. Check the attribute instead. <rdar://problem/8031714> llvm-svn: 142212
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r--llvm/lib/VMCore/Function.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 1215e6a57ce..975ec83b4df 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud