Skip to content

Commit a38911a

Browse files
authored
Rollup merge of #123591 - Zalathar:useless-cast, r=cuviper
Remove unnecessary cast from `LLVMRustGetInstrProfIncrementIntrinsic` (Noticed while reviewing #123409.) This particular cast appears to have been copied over from clang, but there are plenty of other call sites in clang that don't bother with a cast here, and it works fine without one. For context, `llvm::Intrinsic::ID` is a typedef for `unsigned`, and `llvm::Intrinsic::instrprof_increment` is a member of `enum IndependentIntrinsics : unsigned`. --- The formatting change in `unwrap(M)` is the result of manually running `clang-format` on this file, and then reverting all changes other than the ones affecting these lines.
2 parents 984767e + e38dfc4 commit a38911a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1524,8 +1524,8 @@ extern "C" LLVMValueRef LLVMRustBuildCall(LLVMBuilderRef B, LLVMTypeRef Ty, LLVM
15241524
}
15251525

15261526
extern "C" LLVMValueRef LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M) {
1527-
return wrap(llvm::Intrinsic::getDeclaration(unwrap(M),
1528-
(llvm::Intrinsic::ID)llvm::Intrinsic::instrprof_increment));
1527+
return wrap(llvm::Intrinsic::getDeclaration(
1528+
unwrap(M), llvm::Intrinsic::instrprof_increment));
15291529
}
15301530

15311531
extern "C" LLVMValueRef LLVMRustBuildMemCpy(LLVMBuilderRef B,

0 commit comments

Comments
 (0)