Update LLVM and add Unsupported diagnostic
Secure entry functions do not support if arguments are passed on the stack. An "unsupported" diagnostic will be emitted by LLVM if that is the case. This commits adds support in Rust for that diagnostic so that an error will be output if that is the case! Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
This commit is contained in:
parent
511ed9f235
commit
d255d70e7a
4 changed files with 13 additions and 0 deletions
|
@ -344,6 +344,13 @@ unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void
|
||||||
.expect("non-UTF8 diagnostic");
|
.expect("non-UTF8 diagnostic");
|
||||||
diag_handler.warn(&msg);
|
diag_handler.warn(&msg);
|
||||||
}
|
}
|
||||||
|
llvm::diagnostic::Unsupported(diagnostic_ref) => {
|
||||||
|
let msg = llvm::build_string(|s| {
|
||||||
|
llvm::LLVMRustWriteDiagnosticInfoToString(diagnostic_ref, s)
|
||||||
|
})
|
||||||
|
.expect("non-UTF8 diagnostic");
|
||||||
|
diag_handler.err(&msg);
|
||||||
|
}
|
||||||
llvm::diagnostic::UnknownDiagnostic(..) => {}
|
llvm::diagnostic::UnknownDiagnostic(..) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,7 @@ pub enum Diagnostic<'ll> {
|
||||||
InlineAsm(InlineAsmDiagnostic<'ll>),
|
InlineAsm(InlineAsmDiagnostic<'ll>),
|
||||||
PGO(&'ll DiagnosticInfo),
|
PGO(&'ll DiagnosticInfo),
|
||||||
Linker(&'ll DiagnosticInfo),
|
Linker(&'ll DiagnosticInfo),
|
||||||
|
Unsupported(&'ll DiagnosticInfo),
|
||||||
|
|
||||||
/// LLVM has other types that we do not wrap here.
|
/// LLVM has other types that we do not wrap here.
|
||||||
UnknownDiagnostic(&'ll DiagnosticInfo),
|
UnknownDiagnostic(&'ll DiagnosticInfo),
|
||||||
|
@ -159,6 +160,7 @@ impl Diagnostic<'ll> {
|
||||||
|
|
||||||
Dk::PGOProfile => PGO(di),
|
Dk::PGOProfile => PGO(di),
|
||||||
Dk::Linker => Linker(di),
|
Dk::Linker => Linker(di),
|
||||||
|
Dk::Unsupported => Unsupported(di),
|
||||||
|
|
||||||
_ => UnknownDiagnostic(di),
|
_ => UnknownDiagnostic(di),
|
||||||
}
|
}
|
||||||
|
|
|
@ -483,6 +483,7 @@ pub enum DiagnosticKind {
|
||||||
OptimizationFailure,
|
OptimizationFailure,
|
||||||
PGOProfile,
|
PGOProfile,
|
||||||
Linker,
|
Linker,
|
||||||
|
Unsupported,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// LLVMRustDiagnosticLevel
|
/// LLVMRustDiagnosticLevel
|
||||||
|
|
|
@ -1171,6 +1171,7 @@ enum class LLVMRustDiagnosticKind {
|
||||||
OptimizationFailure,
|
OptimizationFailure,
|
||||||
PGOProfile,
|
PGOProfile,
|
||||||
Linker,
|
Linker,
|
||||||
|
Unsupported,
|
||||||
};
|
};
|
||||||
|
|
||||||
static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
|
static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
|
||||||
|
@ -1197,6 +1198,8 @@ static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
|
||||||
return LLVMRustDiagnosticKind::PGOProfile;
|
return LLVMRustDiagnosticKind::PGOProfile;
|
||||||
case DK_Linker:
|
case DK_Linker:
|
||||||
return LLVMRustDiagnosticKind::Linker;
|
return LLVMRustDiagnosticKind::Linker;
|
||||||
|
case DK_Unsupported:
|
||||||
|
return LLVMRustDiagnosticKind::Unsupported;
|
||||||
default:
|
default:
|
||||||
return (Kind >= DK_FirstRemark && Kind <= DK_LastRemark)
|
return (Kind >= DK_FirstRemark && Kind <= DK_LastRemark)
|
||||||
? LLVMRustDiagnosticKind::OptimizationRemarkOther
|
? LLVMRustDiagnosticKind::OptimizationRemarkOther
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue