PALNew = PAL.addAttributes(t->getContext(), Index, B);
#else
AttrBuilder B(t->getContext());
- for (LLVMAttributeRef Attr : makeArrayRef(Attrs, AttrsLen))
+ for (LLVMAttributeRef Attr : ArrayRef<LLVMAttributeRef>(Attrs, AttrsLen))
B.addAttribute(unwrap(Attr));
PALNew = PAL.addAttributesAtIndex(t->getContext(), Index, B);
#endif
}
extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32_t ElementSizeArg) {
- return wrap(Attribute::getWithAllocSizeArgs(*unwrap(C), ElementSizeArg, None));
+ return wrap(Attribute::getWithAllocSizeArgs(*unwrap(C), ElementSizeArg,
+#if LLVM_VERSION_LT(16, 0)
+ None
+#else
+ std::nullopt
+#endif
+ ));
}
#if LLVM_VERSION_GE(15, 0)
#endif
switch (Kind) {
case LLVMRustChecksumKind::None:
+#if LLVM_VERSION_LT(16, 0)
return None;
+#else
+ return std::nullopt;
+#endif
case LLVMRustChecksumKind::MD5:
return DIFile::ChecksumKind::CSK_MD5;
case LLVMRustChecksumKind::SHA1:
LLVMRustDIBuilderRef Builder, const char *Name, size_t NameLen,
const uint64_t Value[2], unsigned SizeInBits, bool IsUnsigned) {
return wrap(Builder->createEnumerator(StringRef(Name, NameLen),
- APSInt(APInt(SizeInBits, makeArrayRef(Value, 2)), IsUnsigned)));
+ APSInt(APInt(SizeInBits, ArrayRef<uint64_t>(Value, 2)), IsUnsigned)));
}
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateEnumerationType(
extern "C" OperandBundleDef *LLVMRustBuildOperandBundleDef(const char *Name,
LLVMValueRef *Inputs,
unsigned NumInputs) {
- return new OperandBundleDef(Name, makeArrayRef(unwrap(Inputs), NumInputs));
+ return new OperandBundleDef(Name, ArrayRef<Value*>(unwrap(Inputs), NumInputs));
}
extern "C" void LLVMRustFreeOperandBundleDef(OperandBundleDef *Bundle) {
Value *Callee = unwrap(Fn);
FunctionType *FTy = unwrap<FunctionType>(Ty);
return wrap(unwrap(B)->CreateCall(
- FTy, Callee, makeArrayRef(unwrap(Args), NumArgs),
- makeArrayRef(*OpBundles, NumOpBundles)));
+ FTy, Callee, ArrayRef<Value*>(unwrap(Args), NumArgs),
+ ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles)));
}
extern "C" LLVMValueRef LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M) {
Value *Callee = unwrap(Fn);
FunctionType *FTy = unwrap<FunctionType>(Ty);
return wrap(unwrap(B)->CreateInvoke(FTy, Callee, unwrap(Then), unwrap(Catch),
- makeArrayRef(unwrap(Args), NumArgs),
- makeArrayRef(*OpBundles, NumOpBundles),
+ ArrayRef<Value*>(unwrap(Args), NumArgs),
+ ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles),
Name));
}