Skip to content

Commit 8fda82e

Browse files
authored
Remove use of ArrayRef(std::nullopt_t) constructor (#59973)
This is deprecated on LLVM 21 and in almost all cases this could be replaced with a simple `{}` which is both shorter and clearer that it was an array argument expected here. Only exception is constructor of `jl_cgval_t` due to an ambiguity. As far as I can tell, all the places that was replaced has always been taking an `ArrayRef` so this should work on older LLVM versions as well.
2 parents 5ee0816 + c733f41 commit 8fda82e

File tree

6 files changed

+49
-50
lines changed

6 files changed

+49
-50
lines changed

‎src/cgutils.cpp‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void jl_debugcache_t::initialize(Module *m){
308308
jl_di_func_sig = dbuilder.createSubroutineType(
309309
dbuilder.getOrCreateTypeArray(diargs));
310310
jl_di_func_null_sig = dbuilder.createSubroutineType(
311-
dbuilder.getOrCreateTypeArray(None));
311+
dbuilder.getOrCreateTypeArray({}));
312312
}
313313

314314
static Value *emit_pointer_from_objref(jl_codectx_t &ctx, Value *V)
@@ -580,7 +580,7 @@ static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *c
580580
// since the load at the new location satisfy the same condition as the original one.
581581
// Mark the global as constant to LLVM code using our own metadata
582582
// which is much less likely to be striped.
583-
gv->setMetadata("julia.constgv", MDNode::get(gv->getContext(), None));
583+
gv->setMetadata("julia.constgv", MDNode::get(gv->getContext(), {}));
584584
assert(localname == gv->getName());
585585
assert(!gv->hasInitializer());
586586
return gv;
@@ -698,7 +698,7 @@ static inline Instruction *maybe_mark_load_dereferenceable(Instruction *LI, bool
698698
if (isa<PointerType>(LI->getType())){
699699
if (!can_be_null)
700700
// The `dereferenceable` below does not imply `nonnull` for non addrspace(0) pointers.
701-
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(LI->getContext(), None));
701+
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(LI->getContext(), {}));
702702
if (size){
703703
Metadata *OP = ConstantAsMetadata::get(ConstantInt::get(getInt64Ty(LI->getContext()), size));
704704
LI->setMetadata(can_be_null ? LLVMContext::MD_dereferenceable_or_null : LLVMContext::MD_dereferenceable,
@@ -1907,7 +1907,7 @@ static Value *emit_typeof(jl_codectx_t &ctx, Value *v, bool maybenull, bool just
19071907
Value *smallp = emit_ptrgep(ctx, prepare_global_in(M, jl_small_typeof_var), tag);
19081908
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_const);
19091909
auto small = ctx.builder.CreateAlignedLoad(typetag->getType(), smallp, M->getDataLayout().getPointerABIAlignment(0));
1910-
small->setMetadata(LLVMContext::MD_nonnull, MDNode::get(M->getContext(), None));
1910+
small->setMetadata(LLVMContext::MD_nonnull, MDNode::get(M->getContext(), {}));
19111911
return ai.decorateInst(small);
19121912
});
19131913
});
@@ -2605,8 +2605,7 @@ static jl_cgval_t typed_store(jl_codectx_t &ctx,
26052605
FunctionType::get(StructType::get(elty, elty),{ptr->getType(), ctx.builder.getPtrTy(), ctx.builder.getInt8Ty(), ctx.builder.getInt8Ty()}, true),
26062606
AttributeList::get(elty->getContext(),
26072607
Attributes(elty->getContext(),{Attribute::NoMerge}), // prevent llvm from merging calls to different functions
2608-
AttributeSet(),
2609-
None));
2608+
AttributeSet(),{}));
26102609
SmallVector<Value*,0> Args ={ptr, op, ctx.builder.getInt8((unsigned)Order), ctx.builder.getInt8(SyncScope::System)};
26112610
if (rhs.V)
26122611
Args.push_back(rhs.V);
@@ -3533,7 +3532,7 @@ static Value *emit_genericmemoryptr(jl_codectx_t &ctx, Value *mem, const jl_data
35333532
PointerType *PPT = cast<PointerType>(ctx.types().T_jlgenericmemory->getElementType(1));
35343533
LoadInst *LI = ctx.builder.CreateAlignedLoad(PPT, addr, Align(sizeof(char*)));
35353534
LI->setOrdering(AtomicOrdering::NotAtomic);
3536-
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), None));
3535+
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), {}));
35373536
jl_aliasinfo_t aliasinfo = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_memoryptr);
35383537
aliasinfo.decorateInst(LI);
35393538
Value *ptr = LI;
@@ -3552,7 +3551,7 @@ static Value *emit_genericmemoryowner(jl_codectx_t &ctx, Value *t)
35523551
Type *T_data = ctx.types().T_jlgenericmemory->getElementType(1);
35533552
LoadInst *LI = ctx.builder.CreateAlignedLoad(T_data, addr, Align(sizeof(char*)));
35543553
LI->setOrdering(AtomicOrdering::NotAtomic);
3555-
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), None));
3554+
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), {}));
35563555
jl_aliasinfo_t aliasinfo_mem = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_memoryown);
35573556
aliasinfo_mem.decorateInst(LI);
35583557
addr = emit_ptrgep(ctx, m, JL_SMALL_BYTE_ALIGNMENT);

‎src/codegen.cpp‎

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,15 @@ static AttributeList get_attrs_noreturn(LLVMContext &C)
625625
returnAttributeList::get(C,
626626
Attributes(C,{Attribute::NoReturn}),
627627
AttributeSet(),
628-
None);
628+
{});
629629
}
630630

631631
static AttributeList get_attrs_basic(LLVMContext &C)
632632
{
633633
returnAttributeList::get(C,
634634
AttributeSet(),
635635
Attributes(C,{Attribute::NonNull}),
636-
None);
636+
{});
637637
}
638638

639639
static AttributeList get_attrs_box_float(LLVMContext &C, unsigned nbytes)
@@ -649,7 +649,7 @@ static AttributeList get_attrs_box_float(LLVMContext &C, unsigned nbytes)
649649
returnAttributeList::get(C,
650650
AttributeSet::get(C, FnAttrs),
651651
AttributeSet::get(C, RetAttrs),
652-
None);
652+
{});
653653
}
654654

655655
static AttributeList get_attrs_box_sext(LLVMContext &C, unsigned nbytes)
@@ -936,7 +936,7 @@ static const auto jltopeval_func = new JuliaFunction<>{
936936
[](LLVMContext &C){returnAttributeList::get(C,
937937
AttributeSet(),
938938
Attributes(C,{Attribute::NonNull}),
939-
None)},
939+
{})},
940940
};
941941
staticconstauto jlcopyast_func = new JuliaFunction<>{
942942
XSTR(jl_copy_ast),
@@ -948,7 +948,7 @@ static const auto jlcopyast_func = new JuliaFunction<>{
948948
[](LLVMContext &C){returnAttributeList::get(C,
949949
AttributeSet(),
950950
Attributes(C,{Attribute::NonNull}),
951-
None)},
951+
{})},
952952
};
953953
staticconstauto jlapplygeneric_func = new JuliaFunction<>{
954954
XSTR(jl_apply_generic),
@@ -1052,7 +1052,7 @@ static const auto jlleave_func = new JuliaFunction<>{
10521052
returnAttributeList::get(C,
10531053
AttributeSet::get(C, FnAttrs),
10541054
AttributeSet(),
1055-
None);
1055+
{});
10561056
},
10571057
};
10581058
staticconstauto jlleave_noexcept_func = new JuliaFunction<>{
@@ -1069,7 +1069,7 @@ static const auto jlleave_noexcept_func = new JuliaFunction<>{
10691069
returnAttributeList::get(C,
10701070
AttributeSet::get(C, FnAttrs),
10711071
AttributeSet(),
1072-
None);
1072+
{});
10731073
},
10741074
};
10751075
staticconstauto jl_restore_excstack_func = new JuliaFunction<TypeFnContextAndSizeT>{
@@ -1099,7 +1099,7 @@ static const auto jlegalx_func = new JuliaFunction<TypeFnContextAndSizeT>{
10991099
returnAttributeList::get(C,
11001100
AttributeSet::get(C, FnAttrs),
11011101
AttributeSet(),
1102-
None)},
1102+
{})},
11031103
};
11041104
staticconstauto jl_alloc_obj_func = new JuliaFunction<TypeFnContextAndSizeT>{
11051105
"julia.gc_alloc_obj",
@@ -1122,7 +1122,7 @@ static const auto jl_alloc_obj_func = new JuliaFunction<TypeFnContextAndSizeT>{
11221122
returnAttributeList::get(C,
11231123
AttributeSet::get(C, FnAttrs),
11241124
AttributeSet::get(C, RetAttrs),
1125-
None);
1125+
{});
11261126
},
11271127
};
11281128
staticconstauto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<TypeFnContextAndSizeT>{
@@ -1145,7 +1145,7 @@ static const auto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<Type
11451145
returnAttributeList::get(C,
11461146
AttributeSet::get(C, FnAttrs),
11471147
AttributeSet::get(C, RetAttrs),
1148-
None);
1148+
{});
11491149
},
11501150
};
11511151
staticconstauto jl_newbits_func = new JuliaFunction<>{
@@ -1158,7 +1158,7 @@ static const auto jl_newbits_func = new JuliaFunction<>{
11581158
[](LLVMContext &C){returnAttributeList::get(C,
11591159
AttributeSet(),
11601160
Attributes(C,{Attribute::NonNull}),
1161-
None)},
1161+
{})},
11621162
};
11631163
// `julia.typeof` does read memory, but it is effectively readnone before we lower
11641164
// the allocation function. This is OK as long as we lower `julia.typeof` no later than
@@ -1178,7 +1178,7 @@ static const auto jl_typeof_func = new JuliaFunction<>{
11781178
returnAttributeList::get(C,
11791179
AttributeSet::get(C, FnAttrs),
11801180
Attributes(C,{Attribute::NonNull}),
1181-
None)},
1181+
{})},
11821182
};
11831183

11841184
staticconstauto jl_write_barrier_func = new JuliaFunction<>{
@@ -1230,7 +1230,7 @@ static const auto jlapplytype_func = new JuliaFunction<>{
12301230
AttributeSet(),
12311231
AttributeSet::get(C, ArrayRef<Attribute>({Attribute::get(C, Attribute::NonNull),
12321232
Attribute::getWithAlignment(C, Align(16))})),
1233-
None);
1233+
{});
12341234
},
12351235
};
12361236
staticconstauto jl_object_id__func = new JuliaFunction<TypeFnContextAndSizeT>{
@@ -1251,7 +1251,7 @@ static const auto setjmp_func = new JuliaFunction<TypeFnContextAndTriple>{
12511251
[](LLVMContext &C){returnAttributeList::get(C,
12521252
Attributes(C,{Attribute::ReturnsTwice}),
12531253
AttributeSet(),
1254-
None)},
1254+
{})},
12551255
};
12561256
staticconstauto memcmp_func = new JuliaFunction<TypeFnContextAndSizeT>{
12571257
XSTR(memcmp),
@@ -1264,7 +1264,7 @@ static const auto memcmp_func = new JuliaFunction<TypeFnContextAndSizeT>{
12641264
returnAttributeList::get(C,
12651265
AttributeSet::get(C, FnAttrs),
12661266
AttributeSet(),
1267-
None)},
1267+
{})},
12681268
// TODO: inferLibFuncAttributes(*memcmp_func, TLI);
12691269
};
12701270
staticconstauto jldlsym_func = new JuliaFunction<>{
@@ -1298,7 +1298,7 @@ static const auto jlgetnthfieldchecked_func = new JuliaFunction<TypeFnContextAnd
12981298
[](LLVMContext &C){returnAttributeList::get(C,
12991299
AttributeSet(),
13001300
Attributes(C,{Attribute::NonNull}),
1301-
None)},
1301+
{})},
13021302
};
13031303
staticconstauto jlfieldindex_func = new JuliaFunction<>{
13041304
XSTR(jl_field_index),
@@ -1315,7 +1315,7 @@ static const auto jlfieldindex_func = new JuliaFunction<>{
13151315
returnAttributeList::get(C,
13161316
AttributeSet::get(C, FnAttrs),
13171317
AttributeSet(),
1318-
None)}, // This function can error if the third argument is 1 so don't do that.
1318+
{})}, // This function can error if the third argument is 1 so don't do that.
13191319
};
13201320
staticconstauto jlfieldisdefinedchecked_func = new JuliaFunction<TypeFnContextAndSizeT>{
13211321
XSTR(jl_field_isdefined_checked),
@@ -1327,7 +1327,7 @@ static const auto jlfieldisdefinedchecked_func = new JuliaFunction<TypeFnContext
13271327
[](LLVMContext &C){returnAttributeList::get(C,
13281328
AttributeSet(),
13291329
Attributes(C,{}),
1330-
None)},
1330+
{})},
13311331
};
13321332
staticconstauto jlgetcfunctiontrampoline_func = new JuliaFunction<>{
13331333
XSTR(jl_get_cfunction_trampoline),
@@ -1349,7 +1349,7 @@ static const auto jlgetcfunctiontrampoline_func = new JuliaFunction<>{
13491349
[](LLVMContext &C){returnAttributeList::get(C,
13501350
AttributeSet(),
13511351
Attributes(C,{Attribute::NonNull}),
1352-
None)},
1352+
{})},
13531353
};
13541354
staticconstauto jlgetabiconverter_func = new JuliaFunction<TypeFnContextAndSizeT>{
13551355
XSTR(jl_get_abi_converter),
@@ -1389,7 +1389,7 @@ static const auto jl_allocgenericmemory = new JuliaFunction<TypeFnContextAndSize
13891389
returnAttributeList::get(C,
13901390
AttributeSet::get(C, FnAttrs),
13911391
AttributeSet::get(C, RetAttrs),
1392-
None)},
1392+
{})},
13931393
};
13941394
#defineBOX_FUNC(ct,at,attrs,nbytes) \
13951395
staticconstauto box_##ct##_func = new JuliaFunction<>{\
@@ -1431,7 +1431,7 @@ static const auto jldnd_func = new JuliaFunction<>{
14311431
returnAttributeList::get(C,
14321432
AttributeSet::get(C, FnAttrs),
14331433
Attributes(C,{}),
1434-
None);
1434+
{});
14351435
},
14361436
};
14371437

@@ -1466,7 +1466,7 @@ static const auto pointer_from_objref_func = new JuliaFunction<>{
14661466
returnAttributeList::get(C,
14671467
AttributeSet::get(C, FnAttrs),
14681468
Attributes(C,{Attribute::NonNull}),
1469-
None)},
1469+
{})},
14701470
};
14711471
staticconstauto gc_loaded_func = new JuliaFunction<>{
14721472
"julia.gc_loaded",
@@ -1680,7 +1680,7 @@ struct jl_aliasinfo_t{
16801680
MDNode *operand = cast<MDNode>(this->scope->getOperand(0));
16811681
auto scope_name = cast<MDString>(operand->getOperand(0))->getString();
16821682
if (scope_name == "jnoalias_const")
1683-
inst->setMetadata(LLVMContext::MD_invariant_load, MDNode::get(inst->getContext(), None));
1683+
inst->setMetadata(LLVMContext::MD_invariant_load, MDNode::get(inst->getContext(), {}));
16841684
}
16851685
}
16861686

@@ -2065,7 +2065,7 @@ jl_aliasinfo_t jl_aliasinfo_t::fromTBAA(jl_codectx_t &ctx, MDNode *tbaa){
20652065

20662066
static Type *julia_type_to_llvm(jl_codectx_t &ctx, jl_value_t *jt, bool *isboxed = NULL);
20672067
staticjl_returninfo_tget_specsig_function(jl_codegen_params_t &ctx, Module *M, Value *fval, StringRef name, jl_value_t *sig, jl_value_t *jlrettype, bool is_opaque_closure,
2068-
ArrayRef<constchar*> ArgNames=None, unsigned nreq=0);
2068+
ArrayRef<constchar*> ArgNames={}, unsigned nreq=0);
20692069
staticjl_cgval_temit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaval = -1);
20702070
staticjl_cgval_temit_checked_var(jl_codectx_t &ctx, Value *bp, jl_sym_t *name, jl_value_t *scope, bool isvol, MDNode *tbaa);
20712071
staticjl_cgval_temit_sparam(jl_codectx_t &ctx, size_t i);
@@ -2243,7 +2243,7 @@ static inline jl_cgval_t ghostValue(jl_codectx_t &ctx, jl_value_t *typ)
22432243
if (jl_is_type_type(typ)){
22442244
assert(is_uniquerep_Type(typ));
22452245
// replace T::Type{T} with T, by assuming that T must be a leaftype of some sort
2246-
jl_cgval_tconstant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2246+
jl_cgval_tconstant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
22472247
constant.constant = jl_tparam0(typ);
22482248
if (typ == (jl_value_t*)jl_typeofbottom_type->super)
22492249
constant.isghost = true;
@@ -2267,13 +2267,13 @@ static inline jl_cgval_t mark_julia_const(jl_codectx_t &ctx, jl_value_t *jv)
22672267
if (jl_is_datatype_singleton((jl_datatype_t*)typ))
22682268
returnghostValue(ctx, typ);
22692269
}
2270-
jl_cgval_tconstant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2270+
jl_cgval_tconstant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
22712271
constant.constant = jv;
22722272
return constant;
22732273
}
22742274

22752275

2276-
staticinlinejl_cgval_tmark_julia_slot(Value *v, jl_value_t *typ, Value *tindex, MDNode *tbaa, ArrayRef<Value*> inline_roots=None)
2276+
staticinlinejl_cgval_tmark_julia_slot(Value *v, jl_value_t *typ, Value *tindex, MDNode *tbaa, ArrayRef<Value*> inline_roots={})
22772277
{
22782278
// this enables lazy-copying of immutable values and stack or argument slots
22792279
jl_cgval_ttagval(v, false, typ, tindex, tbaa, inline_roots);
@@ -2353,7 +2353,7 @@ static inline jl_cgval_t mark_julia_type(jl_codectx_t &ctx, Value *v, bool isbox
23532353
if (type_is_ghost(T))
23542354
returnghostValue(ctx, typ);
23552355
if (isboxed)
2356-
returnjl_cgval_t(v, isboxed, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2356+
returnjl_cgval_t(v, isboxed, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
23572357
if (v && v->getType()->isAggregateType()){
23582358
// eagerly put this back onto the stack
23592359
// llvm mem2reg pass will remove this if unneeded
@@ -2414,7 +2414,7 @@ static inline jl_cgval_t update_julia_type(jl_codectx_t &ctx, const jl_cgval_t &
24142414
returnjl_cgval_t();
24152415
}
24162416
if (v.Vboxed && (v.isboxed || alwaysboxed)){
2417-
returnjl_cgval_t(v.Vboxed, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2417+
returnjl_cgval_t(v.Vboxed, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
24182418
}
24192419
}
24202420
if (!jl_is_concrete_type(typ))
@@ -2529,7 +2529,7 @@ static jl_cgval_t convert_julia_type_to_union(jl_codectx_t &ctx, const jl_cgval_
25292529
}
25302530
elseif (jl_subtype(v.typ, typ)){
25312531
// convert to a simple isboxed value, since it must be boxed in the new union
2532-
returnjl_cgval_t(boxed(ctx, v), true, typ, new_tindex, best_tbaa(ctx.tbaa(), typ), None);
2532+
returnjl_cgval_t(boxed(ctx, v), true, typ, new_tindex, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
25332533
}
25342534
else{
25352535
if (!allow_mismatch)
@@ -2792,7 +2792,7 @@ static jl_cgval_t convert_julia_type_to_union(jl_codectx_t &ctx, const jl_cgval_
27922792
if (!computed_new_index_early && isa<Constant>(new_tindex)){
27932793
// no new tindex (it is set to UNION_BOX_MARKER), so the new value must be something boxed in the new union
27942794
// TODO: use ret.Vboxed or box_union directly to set skip instead of emitting a trap?
2795-
returnjl_cgval_t(boxed(ctx, v), true, typ, new_tindex, best_tbaa(ctx.tbaa(), typ), None);
2795+
returnjl_cgval_t(boxed(ctx, v), true, typ, new_tindex, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
27962796
}
27972797
// some of the values are still unboxed
27982798
setName(ctx.emission_context, new_tindex, "tindex");
@@ -5770,7 +5770,7 @@ static jl_cgval_t emit_varinfo(jl_codectx_t &ctx, jl_varinfo_t &vi, jl_sym_t *va
57705770
Value *tindex = NULL;
57715771
if (vi.pTIndex)
57725772
tindex = ctx.builder.CreateAlignedLoad(getInt8Ty(ctx.builder.getContext()), vi.pTIndex, Align(1), vi.isVolatile);
5773-
v = mark_julia_slot(ssaslot, vi.value.typ, tindex, ctx.tbaa().tbaa_stack, None);
5773+
v = mark_julia_slot(ssaslot, vi.value.typ, tindex, ctx.tbaa().tbaa_stack);
57745774
}
57755775
if (vi.inline_roots){
57765776
AllocaInst *varslot = vi.inline_roots;
@@ -6734,7 +6734,7 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaidx_
67346734
SmallVector<Metadata *, 8> MDs;
67356735

67366736
// Reserve first location for self reference to the LoopID metadata node.
6737-
TempMDTuple TempNode = MDNode::getTemporary(ctx.builder.getContext(), None);
6737+
TempMDTuple TempNode = MDNode::getTemporary(ctx.builder.getContext(), {});
67386738
MDs.push_back(TempNode.get());
67396739

67406740
for (int i = 0, ie = nargs; i < ie; ++i){
@@ -8799,7 +8799,7 @@ static jl_llvm_functions_t
87998799
AllocaInst *roots = sizes.second > 0 ? emit_static_roots(ctx, sizes.second) : nullptr;
88008800
if (bits) bits->setName(jl_symbol_name(s));
88018801
if (roots) roots->setName(StringRef(".roots.") + jl_symbol_name(s));
8802-
varinfo.value = mark_julia_slot(bits, jt, NULL, ctx.tbaa().tbaa_stack, None);
8802+
varinfo.value = mark_julia_slot(bits, jt, NULL, ctx.tbaa().tbaa_stack, {});
88038803
varinfo.inline_roots = roots;
88048804
varinfo.inline_roots_count = sizes.second;
88058805
alloc_def_flag(ctx, varinfo);

‎src/llvm-codegen-shared.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static inline llvm::Instruction *tbaa_decorate(llvm::MDNode *md, llvm::Instructi
158158
usingnamespacellvm;
159159
inst->setMetadata(llvm::LLVMContext::MD_tbaa, md);
160160
if (llvm::isa<llvm::LoadInst>(inst) && md && md == get_tbaa_const(md->getContext())){
161-
inst->setMetadata(llvm::LLVMContext::MD_invariant_load, llvm::MDNode::get(md->getContext(), std::nullopt));
161+
inst->setMetadata(llvm::LLVMContext::MD_invariant_load, llvm::MDNode::get(md->getContext(), {}));
162162
}
163163
return inst;
164164
}

‎src/llvm-late-gc-lowering.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,7 @@ bool LateLowerGCFrame::CleanupIR(Function &F, State *S, bool *CFGModified){
21982198
} else{
21992199
// remove all operand bundles
22002200
#if JL_LLVM_VERSION >= 200000
2201-
CallInst *NewCall = CallInst::Create(CI, None, CI->getIterator());
2201+
CallInst *NewCall = CallInst::Create(CI, {}, CI->getIterator());
22022202
#else
22032203
CallInst *NewCall = CallInst::Create(CI, None, CI);
22042204
#endif

0 commit comments

Comments
(0)