Skip to content

Commit cda1e01

Browse files
committed
Fix ArrayRef(std::nullopt_t) deprecation
1 parent 73568e8 commit cda1e01

File tree

6 files changed

+47
-48
lines changed

6 files changed

+47
-48
lines changed

src/cgutils.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void jl_debugcache_t::initialize(Module *m) {
284284
jl_di_func_sig = dbuilder.createSubroutineType(
285285
dbuilder.getOrCreateTypeArray(diargs));
286286
jl_di_func_null_sig = dbuilder.createSubroutineType(
287-
dbuilder.getOrCreateTypeArray(None));
287+
dbuilder.getOrCreateTypeArray({}));
288288
}
289289

290290
static Value *emit_pointer_from_objref(jl_codectx_t &ctx, Value *V)
@@ -418,7 +418,7 @@ static Constant *julia_pgv(jl_codegen_params_t &params, Module *M, const char *c
418418
// since the load at the new location satisfy the same condition as the original one.
419419
// Mark the global as constant to LLVM code using our own metadata
420420
// which is much less likely to be striped.
421-
gv->setMetadata("julia.constgv", MDNode::get(gv->getContext(), None));
421+
gv->setMetadata("julia.constgv", MDNode::get(gv->getContext(), {}));
422422
assert(localname == gv->getName());
423423
assert(!gv->hasInitializer());
424424
return gv;
@@ -536,7 +536,7 @@ static inline Instruction *maybe_mark_load_dereferenceable(Instruction *LI, bool
536536
if (isa<PointerType>(LI->getType())) {
537537
if (!can_be_null)
538538
// The `dereferenceable` below does not imply `nonnull` for non addrspace(0) pointers.
539-
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(LI->getContext(), None));
539+
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(LI->getContext(), {}));
540540
if (size) {
541541
Metadata *OP = ConstantAsMetadata::get(ConstantInt::get(getInt64Ty(LI->getContext()), size));
542542
LI->setMetadata(can_be_null ? LLVMContext::MD_dereferenceable_or_null : LLVMContext::MD_dereferenceable,
@@ -1772,7 +1772,7 @@ static Value *emit_typeof(jl_codectx_t &ctx, Value *v, bool maybenull, bool just
17721772
Value *smallp = emit_ptrgep(ctx, prepare_global_in(M, jl_small_typeof_var), tag);
17731773
jl_aliasinfo_t ai = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_const);
17741774
auto small = ctx.builder.CreateAlignedLoad(typetag->getType(), smallp, M->getDataLayout().getPointerABIAlignment(0));
1775-
small->setMetadata(LLVMContext::MD_nonnull, MDNode::get(M->getContext(), None));
1775+
small->setMetadata(LLVMContext::MD_nonnull, MDNode::get(M->getContext(), {}));
17761776
return ai.decorateInst(small);
17771777
});
17781778
});
@@ -2473,8 +2473,7 @@ static jl_cgval_t typed_store(jl_codectx_t &ctx,
24732473
FunctionType::get(StructType::get(elty, elty), {ptr->getType(), ctx.builder.getPtrTy(), ctx.builder.getInt8Ty(), ctx.builder.getInt8Ty()}, true),
24742474
AttributeList::get(elty->getContext(),
24752475
Attributes(elty->getContext(), {Attribute::NoMerge}), // prevent llvm from merging calls to different functions
2476-
AttributeSet(),
2477-
None));
2476+
AttributeSet(), {}));
24782477
SmallVector<Value*,0> Args = {ptr, op, ctx.builder.getInt8((unsigned)Order), ctx.builder.getInt8(SyncScope::System)};
24792478
if (rhs.V)
24802479
Args.push_back(rhs.V);
@@ -3399,7 +3398,7 @@ static Value *emit_genericmemoryptr(jl_codectx_t &ctx, Value *mem, const jl_data
33993398
PointerType *PPT = cast<PointerType>(ctx.types().T_jlgenericmemory->getElementType(1));
34003399
LoadInst *LI = ctx.builder.CreateAlignedLoad(PPT, addr, Align(sizeof(char*)));
34013400
LI->setOrdering(AtomicOrdering::NotAtomic);
3402-
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), None));
3401+
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), {}));
34033402
jl_aliasinfo_t aliasinfo = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_memoryptr);
34043403
aliasinfo.decorateInst(LI);
34053404
Value *ptr = LI;
@@ -3418,7 +3417,7 @@ static Value *emit_genericmemoryowner(jl_codectx_t &ctx, Value *t)
34183417
Type *T_data = ctx.types().T_jlgenericmemory->getElementType(1);
34193418
LoadInst *LI = ctx.builder.CreateAlignedLoad(T_data, addr, Align(sizeof(char*)));
34203419
LI->setOrdering(AtomicOrdering::NotAtomic);
3421-
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), None));
3420+
LI->setMetadata(LLVMContext::MD_nonnull, MDNode::get(ctx.builder.getContext(), {}));
34223421
jl_aliasinfo_t aliasinfo_mem = jl_aliasinfo_t::fromTBAA(ctx, ctx.tbaa().tbaa_memoryown);
34233422
aliasinfo_mem.decorateInst(LI);
34243423
addr = emit_ptrgep(ctx, m, JL_SMALL_BYTE_ALIGNMENT);

src/codegen.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -643,15 +643,15 @@ static AttributeList get_attrs_noreturn(LLVMContext &C)
643643
return AttributeList::get(C,
644644
Attributes(C, {Attribute::NoReturn}),
645645
AttributeSet(),
646-
None);
646+
{});
647647
}
648648

649649
static AttributeList get_attrs_basic(LLVMContext &C)
650650
{
651651
return AttributeList::get(C,
652652
AttributeSet(),
653653
Attributes(C, {Attribute::NonNull}),
654-
None);
654+
{});
655655
}
656656

657657
static AttributeList get_attrs_box_float(LLVMContext &C, unsigned nbytes)
@@ -667,7 +667,7 @@ static AttributeList get_attrs_box_float(LLVMContext &C, unsigned nbytes)
667667
return AttributeList::get(C,
668668
AttributeSet::get(C, FnAttrs),
669669
AttributeSet::get(C, RetAttrs),
670-
None);
670+
{});
671671
}
672672

673673
static AttributeList get_attrs_box_sext(LLVMContext &C, unsigned nbytes)
@@ -954,7 +954,7 @@ static const auto jltopeval_func = new JuliaFunction<>{
954954
[](LLVMContext &C) { return AttributeList::get(C,
955955
AttributeSet(),
956956
Attributes(C, {Attribute::NonNull}),
957-
None); },
957+
{}); },
958958
};
959959
static const auto jlcopyast_func = new JuliaFunction<>{
960960
XSTR(jl_copy_ast),
@@ -966,7 +966,7 @@ static const auto jlcopyast_func = new JuliaFunction<>{
966966
[](LLVMContext &C) { return AttributeList::get(C,
967967
AttributeSet(),
968968
Attributes(C, {Attribute::NonNull}),
969-
None); },
969+
{}); },
970970
};
971971
static const auto jlapplygeneric_func = new JuliaFunction<>{
972972
XSTR(jl_apply_generic),
@@ -1072,7 +1072,7 @@ static const auto jlleave_func = new JuliaFunction<>{
10721072
return AttributeList::get(C,
10731073
AttributeSet::get(C, FnAttrs),
10741074
AttributeSet(),
1075-
None);
1075+
{});
10761076
},
10771077
};
10781078
static const auto jlleave_noexcept_func = new JuliaFunction<>{
@@ -1089,7 +1089,7 @@ static const auto jlleave_noexcept_func = new JuliaFunction<>{
10891089
return AttributeList::get(C,
10901090
AttributeSet::get(C, FnAttrs),
10911091
AttributeSet(),
1092-
None);
1092+
{});
10931093
},
10941094
};
10951095
static const auto jl_restore_excstack_func = new JuliaFunction<TypeFnContextAndSizeT>{
@@ -1119,7 +1119,7 @@ static const auto jlegalx_func = new JuliaFunction<TypeFnContextAndSizeT>{
11191119
return AttributeList::get(C,
11201120
AttributeSet::get(C, FnAttrs),
11211121
AttributeSet(),
1122-
None); },
1122+
{}); },
11231123
};
11241124
static const auto jl_alloc_obj_func = new JuliaFunction<TypeFnContextAndSizeT>{
11251125
"julia.gc_alloc_obj",
@@ -1143,7 +1143,7 @@ static const auto jl_alloc_obj_func = new JuliaFunction<TypeFnContextAndSizeT>{
11431143
return AttributeList::get(C,
11441144
AttributeSet::get(C, FnAttrs),
11451145
AttributeSet::get(C, RetAttrs),
1146-
None);
1146+
{});
11471147
},
11481148
};
11491149
static const auto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<TypeFnContextAndSizeT>{
@@ -1167,7 +1167,7 @@ static const auto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<Type
11671167
return AttributeList::get(C,
11681168
AttributeSet::get(C, FnAttrs),
11691169
AttributeSet::get(C, RetAttrs),
1170-
None);
1170+
{});
11711171
},
11721172
};
11731173
static const auto jl_newbits_func = new JuliaFunction<>{
@@ -1180,7 +1180,7 @@ static const auto jl_newbits_func = new JuliaFunction<>{
11801180
[](LLVMContext &C) { return AttributeList::get(C,
11811181
AttributeSet(),
11821182
Attributes(C, {Attribute::NonNull}),
1183-
None); },
1183+
{}); },
11841184
};
11851185
// `julia.typeof` does read memory, but it is effectively readnone before we lower
11861186
// the allocation function. This is OK as long as we lower `julia.typeof` no later than
@@ -1200,7 +1200,7 @@ static const auto jl_typeof_func = new JuliaFunction<>{
12001200
return AttributeList::get(C,
12011201
AttributeSet::get(C, FnAttrs),
12021202
Attributes(C, {Attribute::NonNull}),
1203-
None); },
1203+
{}); },
12041204
};
12051205

12061206
static const auto jl_write_barrier_func = new JuliaFunction<>{
@@ -1252,7 +1252,7 @@ static const auto jlapplytype_func = new JuliaFunction<>{
12521252
AttributeSet(),
12531253
AttributeSet::get(C, ArrayRef<Attribute>({Attribute::get(C, Attribute::NonNull),
12541254
Attribute::getWithAlignment(C, Align(16))})),
1255-
None);
1255+
{});
12561256
},
12571257
};
12581258
static const auto jl_object_id__func = new JuliaFunction<TypeFnContextAndSizeT>{
@@ -1273,7 +1273,7 @@ static const auto setjmp_func = new JuliaFunction<TypeFnContextAndTriple>{
12731273
[](LLVMContext &C) { return AttributeList::get(C,
12741274
Attributes(C, {Attribute::ReturnsTwice}),
12751275
AttributeSet(),
1276-
None); },
1276+
{}); },
12771277
};
12781278
static const auto memcmp_func = new JuliaFunction<TypeFnContextAndSizeT>{
12791279
XSTR(memcmp),
@@ -1286,7 +1286,7 @@ static const auto memcmp_func = new JuliaFunction<TypeFnContextAndSizeT>{
12861286
return AttributeList::get(C,
12871287
AttributeSet::get(C, FnAttrs),
12881288
AttributeSet(),
1289-
None); },
1289+
{}); },
12901290
// TODO: inferLibFuncAttributes(*memcmp_func, TLI);
12911291
};
12921292
static const auto jldlsym_func = new JuliaFunction<>{
@@ -1320,7 +1320,7 @@ static const auto jlgetnthfieldchecked_func = new JuliaFunction<TypeFnContextAnd
13201320
[](LLVMContext &C) { return AttributeList::get(C,
13211321
AttributeSet(),
13221322
Attributes(C, {Attribute::NonNull}),
1323-
None); },
1323+
{}); },
13241324
};
13251325
static const auto jlfieldindex_func = new JuliaFunction<>{
13261326
XSTR(jl_field_index),
@@ -1337,7 +1337,7 @@ static const auto jlfieldindex_func = new JuliaFunction<>{
13371337
return AttributeList::get(C,
13381338
AttributeSet::get(C, FnAttrs),
13391339
AttributeSet(),
1340-
None); }, // This function can error if the third argument is 1 so don't do that.
1340+
{}); }, // This function can error if the third argument is 1 so don't do that.
13411341
};
13421342
static const auto jlfieldisdefinedchecked_func = new JuliaFunction<TypeFnContextAndSizeT>{
13431343
XSTR(jl_field_isdefined_checked),
@@ -1349,7 +1349,7 @@ static const auto jlfieldisdefinedchecked_func = new JuliaFunction<TypeFnContext
13491349
[](LLVMContext &C) { return AttributeList::get(C,
13501350
AttributeSet(),
13511351
Attributes(C, {}),
1352-
None); },
1352+
{}); },
13531353
};
13541354
static const auto jlgetcfunctiontrampoline_func = new JuliaFunction<>{
13551355
XSTR(jl_get_cfunction_trampoline),
@@ -1371,7 +1371,7 @@ static const auto jlgetcfunctiontrampoline_func = new JuliaFunction<>{
13711371
[](LLVMContext &C) { return AttributeList::get(C,
13721372
AttributeSet(),
13731373
Attributes(C, {Attribute::NonNull}),
1374-
None); },
1374+
{}); },
13751375
};
13761376
static const auto jlgetabiconverter_func = new JuliaFunction<TypeFnContextAndSizeT>{
13771377
XSTR(jl_get_abi_converter),
@@ -1411,7 +1411,7 @@ static const auto jl_allocgenericmemory = new JuliaFunction<TypeFnContextAndSize
14111411
return AttributeList::get(C,
14121412
AttributeSet::get(C, FnAttrs),
14131413
AttributeSet::get(C, RetAttrs),
1414-
None); },
1414+
{}); },
14151415
};
14161416
#define BOX_FUNC(ct,at,attrs,nbytes) \
14171417
static const auto box_##ct##_func = new JuliaFunction<>{ \
@@ -1453,7 +1453,7 @@ static const auto jldnd_func = new JuliaFunction<>{
14531453
return AttributeList::get(C,
14541454
AttributeSet::get(C, FnAttrs),
14551455
Attributes(C, {}),
1456-
None);
1456+
{});
14571457
},
14581458
};
14591459

@@ -1488,7 +1488,7 @@ static const auto pointer_from_objref_func = new JuliaFunction<>{
14881488
return AttributeList::get(C,
14891489
AttributeSet::get(C, FnAttrs),
14901490
Attributes(C, {Attribute::NonNull}),
1491-
None); },
1491+
{}); },
14921492
};
14931493
static const auto gc_loaded_func = new JuliaFunction<>{
14941494
"julia.gc_loaded",
@@ -1683,7 +1683,7 @@ struct jl_aliasinfo_t {
16831683
MDNode *operand = cast<MDNode>(this->scope->getOperand(0));
16841684
auto scope_name = cast<MDString>(operand->getOperand(0))->getString();
16851685
if (scope_name == "jnoalias_const")
1686-
inst->setMetadata(LLVMContext::MD_invariant_load, MDNode::get(inst->getContext(), None));
1686+
inst->setMetadata(LLVMContext::MD_invariant_load, MDNode::get(inst->getContext(), {}));
16871687
}
16881688
}
16891689

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

20452045
static Type *julia_type_to_llvm(jl_codectx_t &ctx, jl_value_t *jt, bool *isboxed = NULL);
20462046
static jl_returninfo_t get_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,
2047-
ArrayRef<const char*> ArgNames=None, unsigned nreq=0);
2047+
ArrayRef<const char*> ArgNames={}, unsigned nreq=0);
20482048
static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaval = -1);
20492049
static jl_cgval_t emit_checked_var(jl_codectx_t &ctx, Value *bp, jl_sym_t *name, jl_value_t *scope, bool isvol, MDNode *tbaa);
20502050
static jl_cgval_t emit_sparam(jl_codectx_t &ctx, size_t i);
@@ -2222,7 +2222,7 @@ static inline jl_cgval_t ghostValue(jl_codectx_t &ctx, jl_value_t *typ)
22222222
if (jl_is_type_type(typ)) {
22232223
assert(is_uniquerep_Type(typ));
22242224
// replace T::Type{T} with T, by assuming that T must be a leaftype of some sort
2225-
jl_cgval_t constant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2225+
jl_cgval_t constant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
22262226
constant.constant = jl_tparam0(typ);
22272227
if (typ == (jl_value_t*)jl_typeofbottom_type->super)
22282228
constant.isghost = true;
@@ -2246,13 +2246,13 @@ static inline jl_cgval_t mark_julia_const(jl_codectx_t &ctx, jl_value_t *jv)
22462246
if (jl_is_datatype_singleton((jl_datatype_t*)typ))
22472247
return ghostValue(ctx, typ);
22482248
}
2249-
jl_cgval_t constant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2249+
jl_cgval_t constant(NULL, true, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
22502250
constant.constant = jv;
22512251
return constant;
22522252
}
22532253

22542254

2255-
static inline jl_cgval_t mark_julia_slot(Value *v, jl_value_t *typ, Value *tindex, MDNode *tbaa, ArrayRef<Value*> inline_roots=None)
2255+
static inline jl_cgval_t mark_julia_slot(Value *v, jl_value_t *typ, Value *tindex, MDNode *tbaa, ArrayRef<Value*> inline_roots={})
22562256
{
22572257
// this enables lazy-copying of immutable values and stack or argument slots
22582258
jl_cgval_t tagval(v, false, typ, tindex, tbaa, inline_roots);
@@ -2338,7 +2338,7 @@ static inline jl_cgval_t mark_julia_type(jl_codectx_t &ctx, Value *v, bool isbox
23382338
return value_to_pointer(ctx, v, typ, NULL);
23392339
}
23402340
if (isboxed)
2341-
return jl_cgval_t(v, isboxed, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2341+
return jl_cgval_t(v, isboxed, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
23422342
return jl_cgval_t(v, typ, NULL);
23432343
}
23442344

@@ -2617,7 +2617,7 @@ static jl_cgval_t convert_julia_type_union(jl_codectx_t &ctx, const jl_cgval_t &
26172617
}
26182618
}
26192619
else {
2620-
return jl_cgval_t(boxed(ctx, v), true, typ, NULL, best_tbaa(ctx.tbaa(), typ), None);
2620+
return jl_cgval_t(boxed(ctx, v), true, typ, NULL, best_tbaa(ctx.tbaa(), typ), ArrayRef<Value*>());
26212621
}
26222622
return jl_cgval_t(v, typ, new_tindex);
26232623
}
@@ -5672,7 +5672,7 @@ static jl_cgval_t emit_varinfo(jl_codectx_t &ctx, jl_varinfo_t &vi, jl_sym_t *va
56725672
Value *tindex = NULL;
56735673
if (vi.pTIndex)
56745674
tindex = ctx.builder.CreateAlignedLoad(getInt8Ty(ctx.builder.getContext()), vi.pTIndex, Align(1), vi.isVolatile);
5675-
v = mark_julia_slot(ssaslot, vi.value.typ, tindex, ctx.tbaa().tbaa_stack, None);
5675+
v = mark_julia_slot(ssaslot, vi.value.typ, tindex, ctx.tbaa().tbaa_stack);
56765676
}
56775677
if (vi.inline_roots) {
56785678
AllocaInst *varslot = vi.inline_roots;
@@ -6630,7 +6630,7 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaidx_
66306630
SmallVector<Metadata *, 8> MDs;
66316631

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

66366636
for (int i = 0, ie = nargs; i < ie; ++i) {
@@ -8665,7 +8665,7 @@ static jl_llvm_functions_t
86658665
AllocaInst *roots = sizes.second > 0 ? emit_static_roots(ctx, sizes.second) : nullptr;
86668666
if (bits) bits->setName(jl_symbol_name(s));
86678667
if (roots) roots->setName(StringRef(".roots.") + jl_symbol_name(s));
8668-
varinfo.value = mark_julia_slot(bits, jt, NULL, ctx.tbaa().tbaa_stack, None);
8668+
varinfo.value = mark_julia_slot(bits, jt, NULL, ctx.tbaa().tbaa_stack, {});
86698669
varinfo.inline_roots = roots;
86708670
alloc_def_flag(ctx, varinfo);
86718671
if (debug_enabled && varinfo.dinfo) {

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
using namespace llvm;
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
@@ -2291,7 +2291,7 @@ bool LateLowerGCFrame::CleanupIR(Function &F, State *S, bool *CFGModified) {
22912291
} else {
22922292
// remove all operand bundles
22932293
#if JL_LLVM_VERSION >= 200000
2294-
CallInst *NewCall = CallInst::Create(CI, None, CI->getIterator());
2294+
CallInst *NewCall = CallInst::Create(CI, {}, CI->getIterator());
22952295
#else
22962296
CallInst *NewCall = CallInst::Create(CI, None, CI);
22972297
#endif

src/llvm-multiversioning.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ void CloneCtx::rewrite_alias(GlobalAlias *alias, Function *F)
687687

688688
auto ptr = irbuilder.CreateLoad(F->getType(), slot);
689689
ptr->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_const);
690-
ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(F->getContext(), None));
690+
ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(F->getContext(), {}));
691691

692692
SmallVector<Value *, 0> Args;
693693
for (auto &arg : trampoline->args())
@@ -846,7 +846,7 @@ static void replaceUsesWithLoad(Function &F, Type *T_size, I2GV should_replace,
846846
#endif
847847
Instruction *ptr = new LoadInst(F.getType(), slot, "", false, insert_before);
848848
ptr->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_const);
849-
ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(ptr->getContext(), None));
849+
ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(ptr->getContext(), {}));
850850
use_i->setOperand(info.use->getOperandNo(),
851851
rewrite_inst_use(uses.get_stack(), T_size, ptr,
852852
insert_before));

0 commit comments

Comments
 (0)