|
8 | 8 | // use ELF because RuntimeDyld COFF X86_64 doesn't seem to work (fails to generate function pointers)?
|
9 | 9 | #define FORCE_ELF
|
10 | 10 | #endif
|
11 |
| -#if defined(_OS_WINDOWS_) || defined(_OS_FREEBSD_) |
12 |
| -# define JL_DISABLE_FPO |
13 |
| -#endif |
14 | 11 | #if defined(_CPU_X86_)
|
15 | 12 | #define JL_NEED_FLOATTEMP_VAR 1
|
16 | 13 | #endif
|
@@ -4444,11 +4441,8 @@ static Function* gen_cfun_wrapper(
|
4444 | 4441 | Function *cw = Function::Create(functype,
|
4445 | 4442 | GlobalVariable::ExternalLinkage,
|
4446 | 4443 | funcName.str(), M);
|
4447 |
| - jl_init_function(cw); |
4448 | 4444 | cw->setAttributes(attributes);
|
4449 |
| -#ifdef JL_DISABLE_FPO |
4450 |
| - cw->addFnAttr("no-frame-pointer-elim", "true"); |
4451 |
| -#endif |
| 4445 | + jl_init_function(cw); |
4452 | 4446 | Function *cw_proto = into ? cw : function_proto(cw);
|
4453 | 4447 | // Save the Function object reference
|
4454 | 4448 | if (sf) {
|
@@ -4763,11 +4757,8 @@ static Function* gen_cfun_wrapper(
|
4763 | 4757 | funcName << "_gfthunk";
|
4764 | 4758 | Function *gf_thunk = Function::Create(returninfo.decl->getFunctionType(),
|
4765 | 4759 | GlobalVariable::InternalLinkage, funcName.str(), M);
|
4766 |
| - jl_init_function(gf_thunk); |
4767 | 4760 | gf_thunk->setAttributes(returninfo.decl->getAttributes());
|
4768 |
| -#ifdef JL_DISABLE_FPO |
4769 |
| - gf_thunk->addFnAttr("no-frame-pointer-elim", "true"); |
4770 |
| -#endif |
| 4761 | + jl_init_function(gf_thunk); |
4771 | 4762 | // build a specsig -> jl_apply_generic converter thunk
|
4772 | 4763 | // this builds a method that calls jl_apply_generic (as a closure over a singleton function pointer),
|
4773 | 4764 | // but which has the signature of a specsig
|
@@ -4844,9 +4835,6 @@ static Function* gen_cfun_wrapper(
|
4844 | 4835 | GlobalVariable::ExternalLinkage,
|
4845 | 4836 | funcName.str(), M);
|
4846 | 4837 | jl_init_function(cw_make);
|
4847 |
| -#ifdef JL_DISABLE_FPO |
4848 |
| - cw_make->addFnAttr("no-frame-pointer-elim", "true"); |
4849 |
| -#endif |
4850 | 4838 | BasicBlock *b0 = BasicBlock::Create(jl_LLVMContext, "top", cw_make);
|
4851 | 4839 | IRBuilder<> cwbuilder(b0);
|
4852 | 4840 | Function::arg_iterator AI = cw_make->arg_begin();
|
@@ -5148,9 +5136,6 @@ static Function *gen_invoke_wrapper(jl_method_instance_t *lam, jl_value_t *jlret
|
5148 | 5136 | add_return_attr(w, Attribute::NonNull);
|
5149 | 5137 | w->addFnAttr(Thunk);
|
5150 | 5138 | jl_init_function(w);
|
5151 |
| -#ifdef JL_DISABLE_FPO |
5152 |
| - w->addFnAttr("no-frame-pointer-elim", "true"); |
5153 |
| -#endif |
5154 | 5139 | Function::arg_iterator AI = w->arg_begin();
|
5155 | 5140 | Value *funcArg = &*AI++;
|
5156 | 5141 | Value *argArray = &*AI++;
|
@@ -5588,23 +5573,8 @@ static std::unique_ptr<Module> emit_function(
|
5588 | 5573 | }
|
5589 | 5574 | declarations->specFunctionObject = strdup(f->getName().str().c_str());
|
5590 | 5575 |
|
5591 |
| -#ifdef JL_DISABLE_FPO |
5592 |
| - f->addFnAttr("no-frame-pointer-elim", "true"); |
5593 |
| -#endif |
5594 | 5576 | if (jlrettype == (jl_value_t*)jl_bottom_type)
|
5595 | 5577 | f->setDoesNotReturn();
|
5596 |
| -#if defined(_OS_WINDOWS_) && !defined(_CPU_X86_64_) |
5597 |
| - // tell Win32 to realign the stack to the next 16-byte boundary |
5598 |
| - // upon entry to any function. This achieves compatibility |
5599 |
| - // with both MinGW-GCC (which assumes an 16-byte-aligned stack) and |
5600 |
| - // i686 Windows (which uses a 4-byte-aligned stack) |
5601 |
| - AttrBuilder *attr = new AttrBuilder(); |
5602 |
| - attr->addStackAlignmentAttr(16); |
5603 |
| - f->addAttributes(AttributeList::FunctionIndex, *attr); |
5604 |
| -#endif |
5605 |
| -#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_) |
5606 |
| - f->setHasUWTable(); // force NeedsWinEH |
5607 |
| -#endif |
5608 | 5578 |
|
5609 | 5579 | #ifdef USE_POLLY
|
5610 | 5580 | if (!jl_has_meta(stmts, polly_sym) || jl_options.polly == JL_OPTIONS_POLLY_OFF) {
|
|
0 commit comments