aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-10-17 18:43:40 +0000
committerBill Wendling <isanbard@gmail.com>2011-10-17 18:43:40 +0000
commit3c5e60994f53eef2808a33b5ca6c3dffc2168054 (patch)
treef77554018088b20adc18a5aca234db259071c838 /lib/VMCore
parent8f3af87e99b9556224480f1aa18d340fb343bbf6 (diff)
downloadexternal_llvm-3c5e60994f53eef2808a33b5ca6c3dffc2168054.zip
external_llvm-3c5e60994f53eef2808a33b5ca6c3dffc2168054.tar.gz
external_llvm-3c5e60994f53eef2808a33b5ca6c3dffc2168054.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142221 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Function.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 975ec83..a6128b0 100644
--- a/lib/VMCore/Function.cpp
+++ b/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