mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-27 07:03:45 +00:00
llvm-wrapper: fix warning C4244
llvm-wrapper/RustWrapper.cpp(1234): warning C4244: '=': conversion from 'uint64_t' to 'unsigned int', possible loss of data nice consistency: uint64_t6009708b43/llvm/include/llvm/IR/DiagnosticInfo.h (L172)
but unsigned6009708b43/llvm/include/llvm/IR/DiagnosticInfo.h (L1091)
This commit is contained in:
parent
bea5bebf3d
commit
205cfcba20
@ -36,7 +36,7 @@ use rustc_span::InnerSpan;
|
||||
use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel};
|
||||
|
||||
use crate::llvm::diagnostic::OptimizationDiagnosticKind;
|
||||
use libc::{c_char, c_int, c_uint, c_void, size_t};
|
||||
use libc::{c_char, c_int, c_void, size_t};
|
||||
use std::ffi::CString;
|
||||
use std::fs;
|
||||
use std::io::{self, Write};
|
||||
@ -406,7 +406,7 @@ fn report_inline_asm(
|
||||
cgcx: &CodegenContext<LlvmCodegenBackend>,
|
||||
msg: String,
|
||||
level: llvm::DiagnosticLevel,
|
||||
mut cookie: c_uint,
|
||||
mut cookie: u64,
|
||||
source: Option<(String, Vec<InnerSpan>)>,
|
||||
) {
|
||||
// In LTO build we may get srcloc values from other crates which are invalid
|
||||
@ -420,7 +420,7 @@ fn report_inline_asm(
|
||||
llvm::DiagnosticLevel::Warning => Level::Warning,
|
||||
llvm::DiagnosticLevel::Note | llvm::DiagnosticLevel::Remark => Level::Note,
|
||||
};
|
||||
cgcx.diag_emitter.inline_asm_error(cookie as u32, msg, level, source);
|
||||
cgcx.diag_emitter.inline_asm_error(cookie.try_into().unwrap(), msg, level, source);
|
||||
}
|
||||
|
||||
unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void) {
|
||||
|
@ -123,7 +123,7 @@ impl SrcMgrDiagnostic {
|
||||
#[derive(Clone)]
|
||||
pub struct InlineAsmDiagnostic {
|
||||
pub level: super::DiagnosticLevel,
|
||||
pub cookie: c_uint,
|
||||
pub cookie: u64,
|
||||
pub message: String,
|
||||
pub source: Option<(String, Vec<InnerSpan>)>,
|
||||
}
|
||||
@ -149,7 +149,7 @@ impl InlineAsmDiagnostic {
|
||||
let smdiag = SrcMgrDiagnostic::unpack(super::LLVMRustGetSMDiagnostic(di, &mut cookie));
|
||||
InlineAsmDiagnostic {
|
||||
level: smdiag.level,
|
||||
cookie,
|
||||
cookie: cookie.into(),
|
||||
message: smdiag.message,
|
||||
source: smdiag.source,
|
||||
}
|
||||
|
@ -2254,7 +2254,7 @@ extern "C" {
|
||||
pub fn LLVMRustUnpackInlineAsmDiagnostic<'a>(
|
||||
DI: &'a DiagnosticInfo,
|
||||
level_out: &mut DiagnosticLevel,
|
||||
cookie_out: &mut c_uint,
|
||||
cookie_out: &mut u64,
|
||||
message_out: &mut Option<&'a Twine>,
|
||||
);
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ enum class LLVMRustDiagnosticLevel {
|
||||
extern "C" void
|
||||
LLVMRustUnpackInlineAsmDiagnostic(LLVMDiagnosticInfoRef DI,
|
||||
LLVMRustDiagnosticLevel *LevelOut,
|
||||
unsigned *CookieOut,
|
||||
uint64_t *CookieOut,
|
||||
LLVMTwineRef *MessageOut) {
|
||||
// Undefined to call this not on an inline assembly diagnostic!
|
||||
llvm::DiagnosticInfoInlineAsm *IA =
|
||||
|
Loading…
Reference in New Issue
Block a user