Skip to content

Commit 69f47e7

Browse files
committed
Change name to force_emit_all
1 parent 44899bf commit 69f47e7

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

base/reflection.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,22 @@ struct CodegenParams
149149
use_jlplt::Cint
150150

151151
"""
152-
If enabled emit LLVM IR even for functions with constant return values.
152+
If enabled emit LLVM IR for all functions even if wouldn't be compiled
153+
for some reason (i.e functions that return a constant value).
153154
"""
154-
force_emit_const::Cint
155+
force_emit_all::Cint
155156

156157
function CodegenParams(; track_allocations::Bool=true, code_coverage::Bool=true,
157158
prefer_specsig::Bool=false,
158159
gnu_pubnames::Bool=true, debug_info_kind::Cint = default_debug_info_kind(),
159160
debug_info_level::Cint = Cint(JLOptions().debug_level), safepoint_on_entry::Bool=true,
160-
gcstack_arg::Bool=true, use_jlplt::Bool=true, force_emit_const::Bool=false)
161+
gcstack_arg::Bool=true, use_jlplt::Bool=true, force_emit_all::Bool=false)
161162
return new(
162163
Cint(track_allocations), Cint(code_coverage),
163164
Cint(prefer_specsig),
164165
Cint(gnu_pubnames), debug_info_kind,
165166
debug_info_level, Cint(safepoint_on_entry),
166-
Cint(gcstack_arg), Cint(use_jlplt), Cint(force_emit_const))
167+
Cint(gcstack_arg), Cint(use_jlplt), Cint(force_emit_all))
167168
end
168169
end
169170

src/aotcompile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ void *jl_emit_native_impl(jl_array_t *codeinfos, LLVMOrcThreadSafeModuleRef llvm
775775
params.tsctx, clone.getModuleUnlocked()->getDataLayout(),
776776
Triple(clone.getModuleUnlocked()->getTargetTriple()));
777777
jl_llvm_functions_t decls;
778-
if (!(params.params->force_emit_const) && jl_atomic_load_relaxed(&codeinst->invoke) == jl_fptr_const_return_addr)
778+
if (!(params.params->force_emit_all) && jl_atomic_load_relaxed(&codeinst->invoke) == jl_fptr_const_return_addr)
779779
decls.functionObject = "jl_fptr_const_return";
780780
else
781781
decls = jl_emit_codeinst(result_m, codeinst, src, params);

src/cgutils.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -4423,7 +4423,8 @@ static int compare_cgparams(const jl_cgparams_t *a, const jl_cgparams_t *b)
44234423
(a->debug_info_kind == b->debug_info_kind) &&
44244424
(a->safepoint_on_entry == b->safepoint_on_entry) &&
44254425
(a->gcstack_arg == b->gcstack_arg) &&
4426-
(a->use_jlplt == b->use_jlplt);
4426+
(a->use_jlplt == b->use_jlplt) &&
4427+
(a->force_emit_all == b->force_emit_all);
44274428
}
44284429
#endif
44294430

src/init.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,8 @@ JL_DLLEXPORT jl_cgparams_t jl_default_cgparams = {
740740
/* debug_info_level */ 0, // later jl_options.debug_level,
741741
/* safepoint_on_entry */ 1,
742742
/* gcstack_arg */ 1,
743-
/* use_jlplt*/ 1 };
743+
/* use_jlplt*/ 1 ,
744+
/*force_emit_all=*/ 0};
744745

745746
static void init_global_mutexes(void) {
746747
JL_MUTEX_INIT(&jl_modules_mutex, "jl_modules_mutex");

src/julia.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2723,7 +2723,7 @@ typedef struct {
27232723
int gcstack_arg; // Pass the ptls value as an argument with swiftself
27242724

27252725
int use_jlplt; // Whether to use the Julia PLT mechanism or emit symbols directly
2726-
int force_emit_const; // Force emission of code for const return functions
2726+
int force_emit_all; // Force emission of code for const return functions
27272727
} jl_cgparams_t;
27282728
extern JL_DLLEXPORT int jl_default_debug_info_kind;
27292729
extern JL_DLLEXPORT jl_cgparams_t jl_default_cgparams;

0 commit comments

Comments
 (0)