@@ -207,15 +207,15 @@ pub unsafe fn create_module<'ll>(
207
207
// If skipping the PLT is enabled, we need to add some module metadata
208
208
// to ensure intrinsic calls don't use it.
209
209
if !sess. needs_plt ( ) {
210
- let avoid_plt = c"RtLibUseGOT" . as_ptr ( ) . cast ( ) ;
210
+ let avoid_plt = c"RtLibUseGOT" . as_ptr ( ) ;
211
211
unsafe {
212
212
llvm:: LLVMRustAddModuleFlagU32 ( llmod, llvm:: LLVMModFlagBehavior :: Warning , avoid_plt, 1 ) ;
213
213
}
214
214
}
215
215
216
216
// Enable canonical jump tables if CFI is enabled. (See https://reviews.llvm.org/D65629.)
217
217
if sess. is_sanitizer_cfi_canonical_jump_tables_enabled ( ) && sess. is_sanitizer_cfi_enabled ( ) {
218
- let canonical_jump_tables = c"CFI Canonical Jump Tables" . as_ptr ( ) . cast ( ) ;
218
+ let canonical_jump_tables = c"CFI Canonical Jump Tables" . as_ptr ( ) ;
219
219
unsafe {
220
220
llvm:: LLVMRustAddModuleFlagU32 (
221
221
llmod,
@@ -228,7 +228,7 @@ pub unsafe fn create_module<'ll>(
228
228
229
229
// Enable LTO unit splitting if specified or if CFI is enabled. (See https://reviews.llvm.org/D53891.)
230
230
if sess. is_split_lto_unit_enabled ( ) || sess. is_sanitizer_cfi_enabled ( ) {
231
- let enable_split_lto_unit = c"EnableSplitLTOUnit" . as_ptr ( ) . cast ( ) ;
231
+ let enable_split_lto_unit = c"EnableSplitLTOUnit" . as_ptr ( ) ;
232
232
unsafe {
233
233
llvm:: LLVMRustAddModuleFlagU32 (
234
234
llmod,
@@ -241,7 +241,7 @@ pub unsafe fn create_module<'ll>(
241
241
242
242
// Add "kcfi" module flag if KCFI is enabled. (See https://reviews.llvm.org/D119296.)
243
243
if sess. is_sanitizer_kcfi_enabled ( ) {
244
- let kcfi = c"kcfi" . as_ptr ( ) . cast ( ) ;
244
+ let kcfi = c"kcfi" . as_ptr ( ) ;
245
245
unsafe {
246
246
llvm:: LLVMRustAddModuleFlagU32 ( llmod, llvm:: LLVMModFlagBehavior :: Override , kcfi, 1 ) ;
247
247
}
@@ -280,26 +280,26 @@ pub unsafe fn create_module<'ll>(
280
280
llvm:: LLVMRustAddModuleFlagU32 (
281
281
llmod,
282
282
llvm:: LLVMModFlagBehavior :: Min ,
283
- c"branch-target-enforcement" . as_ptr ( ) . cast ( ) ,
283
+ c"branch-target-enforcement" . as_ptr ( ) ,
284
284
bti. into ( ) ,
285
285
) ;
286
286
llvm:: LLVMRustAddModuleFlagU32 (
287
287
llmod,
288
288
llvm:: LLVMModFlagBehavior :: Min ,
289
- c"sign-return-address" . as_ptr ( ) . cast ( ) ,
289
+ c"sign-return-address" . as_ptr ( ) ,
290
290
pac_ret. is_some ( ) . into ( ) ,
291
291
) ;
292
292
let pac_opts = pac_ret. unwrap_or ( PacRet { leaf : false , key : PAuthKey :: A } ) ;
293
293
llvm:: LLVMRustAddModuleFlagU32 (
294
294
llmod,
295
295
llvm:: LLVMModFlagBehavior :: Min ,
296
- c"sign-return-address-all" . as_ptr ( ) . cast ( ) ,
296
+ c"sign-return-address-all" . as_ptr ( ) ,
297
297
pac_opts. leaf . into ( ) ,
298
298
) ;
299
299
llvm:: LLVMRustAddModuleFlagU32 (
300
300
llmod,
301
301
llvm:: LLVMModFlagBehavior :: Min ,
302
- c"sign-return-address-with-bkey" . as_ptr ( ) . cast ( ) ,
302
+ c"sign-return-address-with-bkey" . as_ptr ( ) ,
303
303
u32:: from ( pac_opts. key == PAuthKey :: B ) ,
304
304
) ;
305
305
}
@@ -317,7 +317,7 @@ pub unsafe fn create_module<'ll>(
317
317
llvm:: LLVMRustAddModuleFlagU32 (
318
318
llmod,
319
319
llvm:: LLVMModFlagBehavior :: Override ,
320
- c"cf-protection-branch" . as_ptr ( ) . cast ( ) ,
320
+ c"cf-protection-branch" . as_ptr ( ) ,
321
321
1 ,
322
322
) ;
323
323
}
@@ -327,7 +327,7 @@ pub unsafe fn create_module<'ll>(
327
327
llvm:: LLVMRustAddModuleFlagU32 (
328
328
llmod,
329
329
llvm:: LLVMModFlagBehavior :: Override ,
330
- c"cf-protection-return" . as_ptr ( ) . cast ( ) ,
330
+ c"cf-protection-return" . as_ptr ( ) ,
331
331
1 ,
332
332
) ;
333
333
}
@@ -338,7 +338,7 @@ pub unsafe fn create_module<'ll>(
338
338
llvm:: LLVMRustAddModuleFlagU32 (
339
339
llmod,
340
340
llvm:: LLVMModFlagBehavior :: Error ,
341
- c"Virtual Function Elim" . as_ptr ( ) . cast ( ) ,
341
+ c"Virtual Function Elim" . as_ptr ( ) ,
342
342
1 ,
343
343
) ;
344
344
}
0 commit comments