Skip to content

Commit

Permalink
Remove spurious warnings with g++-7.4.0 (#34858)
Browse files Browse the repository at this point in the history
* Complaints about "potentially uninitialized" pointers
* Acknowledge LLVM ORCJIT v1 deprecations
  • Loading branch information
c42f committed Feb 24, 2020
1 parent 835e148 commit 5844117
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,6 @@ JL_CALLABLE(jl_f_fieldtype)
nargs -= 1;
}
JL_NARGS(fieldtype, 2, 2);
jl_datatype_t *st = (jl_datatype_t*)args[0];
return get_fieldtype(args[0], args[1], 1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ static Value *emit_array_nd_index(
for (size_t k = 0; k < nidxs; k++) {
idxs[k] = emit_unbox(ctx, T_size, argv[k], (jl_value_t*)jl_long_type); // type asserted by caller
}
Value *ii;
Value *ii = NULL;
for (size_t k = 0; k < nidxs; k++) {
ii = ctx.builder.CreateSub(idxs[k], ConstantInt::get(T_size, 1));
i = ctx.builder.CreateAdd(i, ctx.builder.CreateMul(ii, stride));
Expand Down
8 changes: 4 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3538,7 +3538,7 @@ static jl_cgval_t emit_global(jl_codectx_t &ctx, jl_sym_t *sym)

static jl_cgval_t emit_isdefined(jl_codectx_t &ctx, jl_value_t *sym)
{
Value *isnull;
Value *isnull = NULL;
if (jl_is_slot(sym)) {
size_t sl = jl_slot_number(sym) - 1;
jl_varinfo_t &vi = ctx.slots[sl];
Expand Down Expand Up @@ -3655,7 +3655,7 @@ static jl_cgval_t emit_varinfo(jl_codectx_t &ctx, jl_varinfo_t &vi, jl_sym_t *va
}
if (vi.boxroot != NULL) {
Instruction *boxed = ctx.builder.CreateLoad(T_prjlvalue, vi.boxroot, vi.isVolatile);
Value *box_isnull;
Value *box_isnull = NULL;
if (vi.usedUndef)
box_isnull = ctx.builder.CreateICmpNE(boxed, maybe_decay_untracked(V_null));
maybe_mark_load_dereferenceable(boxed, vi.usedUndef || vi.pTIndex, typ);
Expand Down Expand Up @@ -5298,7 +5298,7 @@ static Function *gen_invoke_wrapper(jl_method_instance_t *lam, jl_value_t *jlret
size_t nfargs = ftype->getNumParams();
Value **args = (Value**) alloca(nfargs * sizeof(Value*));
unsigned idx = 0;
AllocaInst *result;
AllocaInst *result = NULL;
switch (f.cc) {
case jl_returninfo_t::Boxed:
case jl_returninfo_t::Register:
Expand Down Expand Up @@ -6499,7 +6499,7 @@ static std::unique_ptr<Module> emit_function(
}

Value *isboxed_union = NULL;
Value *retval;
Value *retval = NULL;
Value *sret = has_sret ? f->arg_begin() : NULL;
Type *retty = f->getReturnType();
switch (returninfo.cc) {
Expand Down
2 changes: 2 additions & 0 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ JuliaOJIT::JuliaOJIT(TargetMachine &TM)
cantFail(std::move(Err), "resolveSymbol failed");
})),
ObjectLayer(
AcknowledgeORCv1Deprecation,
ES,
[this](RTDyldObjHandleT) {
ObjLayerT::Resources result;
Expand All @@ -380,6 +381,7 @@ JuliaOJIT::JuliaOJIT(TargetMachine &TM)
std::ref(registrar)
),
CompileLayer(
AcknowledgeORCv1Deprecation,
ObjectLayer,
CompilerT(this)
)
Expand Down

0 comments on commit 5844117

Please sign in to comment.