Port InvalidMinimumAlignment
This commit is contained in:
parent
39d363fd58
commit
5d79d3c4bb
@ -1,6 +1,7 @@
|
||||
use crate::base;
|
||||
use crate::common::{self, CodegenCx};
|
||||
use crate::debuginfo;
|
||||
use crate::errors::InvalidMinimumAlignment;
|
||||
use crate::llvm::{self, True};
|
||||
use crate::llvm_util;
|
||||
use crate::type_::Type;
|
||||
@ -146,7 +147,9 @@ fn set_global_alignment<'ll>(cx: &CodegenCx<'ll, '_>, gv: &'ll Value, mut align:
|
||||
match Align::from_bits(min) {
|
||||
Ok(min) => align = align.max(min),
|
||||
Err(err) => {
|
||||
cx.sess().err(&format!("invalid minimum global alignment: {}", err));
|
||||
cx.sess().emit_err(InvalidMinimumAlignment {
|
||||
err,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,3 +67,9 @@ pub(crate) struct LayoutSizeOverflow {
|
||||
pub span: Span,
|
||||
pub error: String,
|
||||
}
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[diag(codegen_llvm::invalid_minimum_alignment)]
|
||||
pub(crate) struct InvalidMinimumAlignment {
|
||||
pub err: String
|
||||
}
|
||||
|
@ -27,3 +27,6 @@ codegen_llvm_branch_protection_requires_aarch64 =
|
||||
|
||||
codegen_llvm_layout_size_overflow =
|
||||
{$error}
|
||||
|
||||
codegen_llvm_invalid_minimum_alignment =
|
||||
invalid minimum global alignment: {$err}
|
||||
|
Loading…
Reference in New Issue
Block a user