mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user