1
Fork 0

remove remark filtering on the rust side

now that remarks are filtered before cg_llvm's diagnostic handler callback
is called, we don't need to do the filtering post c++-to-rust conversion
of the diagnostic.
This commit is contained in:
Rémy Rakic 2023-07-14 16:09:04 +00:00
parent 77d01103a3
commit ca5a383fb6

View file

@ -382,12 +382,6 @@ unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void
} }
llvm::diagnostic::Optimization(opt) => { llvm::diagnostic::Optimization(opt) => {
let enabled = match cgcx.remark {
Passes::All => true,
Passes::Some(ref v) => v.iter().any(|s| *s == opt.pass_name),
};
if enabled {
diag_handler.emit_note(FromLlvmOptimizationDiag { diag_handler.emit_note(FromLlvmOptimizationDiag {
filename: &opt.filename, filename: &opt.filename,
line: opt.line, line: opt.line,
@ -405,7 +399,6 @@ unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void
message: &opt.message, message: &opt.message,
}); });
} }
}
llvm::diagnostic::PGO(diagnostic_ref) | llvm::diagnostic::Linker(diagnostic_ref) => { llvm::diagnostic::PGO(diagnostic_ref) | llvm::diagnostic::Linker(diagnostic_ref) => {
let message = llvm::build_string(|s| { let message = llvm::build_string(|s| {
llvm::LLVMRustWriteDiagnosticInfoToString(diagnostic_ref, s) llvm::LLVMRustWriteDiagnosticInfoToString(diagnostic_ref, s)