summaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp40
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