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/Analysis | |
parent | f1fddcd9e01ceb38ee7f2951f9e109cccb601654 (diff) | |
download | external_llvm-728662f9e869251ff9b5a847b0cb0daa99d1d250.zip external_llvm-728662f9e869251ff9b5a847b0cb0daa99d1d250.tar.gz external_llvm-728662f9e869251ff9b5a847b0cb0daa99d1d250.tar.bz2 |
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/Analysis')
-rw-r--r-- | lib/Analysis/InlineCost.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index e12e322..65db33c 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -225,12 +225,11 @@ unsigned CodeMetrics::CountCodeReductionForAlloca(Value *V) { /// analyzeFunction - Fill in the current structure with information gleaned /// from the specified function. void CodeMetrics::analyzeFunction(Function *F, const TargetData *TD) { - // If this function contains a call to setjmp or _setjmp, never inline - // it. This is a hack because we depend on the user marking their local - // variables as volatile if they are live across a setjmp call, and they - // probably won't do this in callers. - if (F->callsFunctionThatReturnsTwice()) - callsSetJmp = true; + // If this function contains a call that "returns twice" (e.g., setjmp or + // _setjmp), never inline it. This is a hack because we depend on the user + // marking their local variables as volatile if they are live across a setjmp + // call, and they probably won't do this in callers. + callsSetJmp = F->hasFnAttr(Attribute::ReturnsTwice); // Look at the size of the callee. for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) |