mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[inliner] Fix PR18206 by preventing inlining functions that call setjmp
through an invoke instruction. The original patch for this was written by Mark Seaborn, but I've reworked his test case into the existing returns_twice test case and implemented the fix by the prior refactoring to actually run the cost analysis over invoke instructions, and then here fixing our detection of the returns_twice attribute to work for both calls and invokes. We never noticed because we never saw an invoke. =[ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -713,7 +713,7 @@ bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) {
|
||||
}
|
||||
|
||||
bool CallAnalyzer::visitCallSite(CallSite CS) {
|
||||
if (CS.isCall() && cast<CallInst>(CS.getInstruction())->canReturnTwice() &&
|
||||
if (CS.hasFnAttr(Attribute::ReturnsTwice) &&
|
||||
!F.getAttributes().hasAttribute(AttributeSet::FunctionIndex,
|
||||
Attribute::ReturnsTwice)) {
|
||||
// This aborts the entire analysis.
|
||||
|
Reference in New Issue
Block a user