@@ -239,7 +239,6 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
239239
240240 let args = self.check_call("invoke", llty, llfn, args);
241241 let funclet_bundle = funclet.map(|funclet| funclet.bundle());
242- let funclet_bundle = funclet_bundle.as_ref().map(|b| &*b.raw);
243242 let mut bundles: SmallVec<[_; 2]> = SmallVec::new();
244243 if let Some(funclet_bundle) = funclet_bundle {
245244 bundles.push(funclet_bundle);
@@ -250,13 +249,12 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
250249
251250 // Emit KCFI operand bundle
252251 let kcfi_bundle = self.kcfi_operand_bundle(fn_attrs, fn_abi, instance, llfn);
253- let kcfi_bundle = kcfi_bundle.as_ref().map(|b| &*b.raw);
254- if let Some(kcfi_bundle) = kcfi_bundle {
252+ if let Some(kcfi_bundle) = kcfi_bundle.as_deref() {
255253 bundles.push(kcfi_bundle);
256254 }
257255
258256 let invoke = unsafe {
259- llvm::LLVMRustBuildInvoke (
257+ llvm::LLVMBuildInvokeWithOperandBundles (
260258 self.llbuilder,
261259 llty,
262260 llfn,
@@ -1179,7 +1177,6 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
11791177
11801178 let args = self.check_call("call", llty, llfn, args);
11811179 let funclet_bundle = funclet.map(|funclet| funclet.bundle());
1182- let funclet_bundle = funclet_bundle.as_ref().map(|b| &*b.raw);
11831180 let mut bundles: SmallVec<[_; 2]> = SmallVec::new();
11841181 if let Some(funclet_bundle) = funclet_bundle {
11851182 bundles.push(funclet_bundle);
@@ -1190,20 +1187,20 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
11901187
11911188 // Emit KCFI operand bundle
11921189 let kcfi_bundle = self.kcfi_operand_bundle(fn_attrs, fn_abi, instance, llfn);
1193- let kcfi_bundle = kcfi_bundle.as_ref().map(|b| &*b.raw);
1194- if let Some(kcfi_bundle) = kcfi_bundle {
1190+ if let Some(kcfi_bundle) = kcfi_bundle.as_deref() {
11951191 bundles.push(kcfi_bundle);
11961192 }
11971193
11981194 let call = unsafe {
1199- llvm::LLVMRustBuildCall (
1195+ llvm::LLVMBuildCallWithOperandBundles (
12001196 self.llbuilder,
12011197 llty,
12021198 llfn,
12031199 args.as_ptr() as *const &llvm::Value,
12041200 args.len() as c_uint,
12051201 bundles.as_ptr(),
12061202 bundles.len() as c_uint,
1203+ c"".as_ptr(),
12071204 )
12081205 };
12091206 if let Some(fn_abi) = fn_abi {
@@ -1509,7 +1506,6 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15091506
15101507 let args = self.check_call("callbr", llty, llfn, args);
15111508 let funclet_bundle = funclet.map(|funclet| funclet.bundle());
1512- let funclet_bundle = funclet_bundle.as_ref().map(|b| &*b.raw);
15131509 let mut bundles: SmallVec<[_; 2]> = SmallVec::new();
15141510 if let Some(funclet_bundle) = funclet_bundle {
15151511 bundles.push(funclet_bundle);
@@ -1520,13 +1516,12 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15201516
15211517 // Emit KCFI operand bundle
15221518 let kcfi_bundle = self.kcfi_operand_bundle(fn_attrs, fn_abi, instance, llfn);
1523- let kcfi_bundle = kcfi_bundle.as_ref().map(|b| &*b.raw);
1524- if let Some(kcfi_bundle) = kcfi_bundle {
1519+ if let Some(kcfi_bundle) = kcfi_bundle.as_deref() {
15251520 bundles.push(kcfi_bundle);
15261521 }
15271522
15281523 let callbr = unsafe {
1529- llvm::LLVMRustBuildCallBr (
1524+ llvm::LLVMBuildCallBr (
15301525 self.llbuilder,
15311526 llty,
15321527 llfn,
@@ -1601,7 +1596,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
16011596 fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
16021597 instance: Option<Instance<'tcx>>,
16031598 llfn: &'ll Value,
1604- ) -> Option<llvm::OperandBundleDef <'ll>> {
1599+ ) -> Option<llvm::OperandBundleOwned <'ll>> {
16051600 let is_indirect_call = unsafe { llvm::LLVMRustIsNonGVFunctionPointerTy(llfn) };
16061601 let kcfi_bundle = if self.tcx.sess.is_sanitizer_kcfi_enabled()
16071602 && let Some(fn_abi) = fn_abi
@@ -1627,7 +1622,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
16271622 kcfi::typeid_for_fnabi(self.tcx, fn_abi, options)
16281623 };
16291624
1630- Some(llvm::OperandBundleDef ::new("kcfi", &[self.const_u32(kcfi_typeid)]))
1625+ Some(llvm::OperandBundleOwned ::new("kcfi", &[self.const_u32(kcfi_typeid)]))
16311626 } else {
16321627 None
16331628 };
0 commit comments