refactor check_{lang,library}_ub: use a single intrinsic, put policy into library
This commit is contained in:
parent
987ef4c922
commit
6177530420
34 changed files with 133 additions and 118 deletions
|
@ -680,8 +680,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
let val = layout.offset_of_subfield(bx.cx(), fields.iter()).bytes();
|
||||
bx.cx().const_usize(val)
|
||||
}
|
||||
mir::NullOp::UbCheck(_) => {
|
||||
// In codegen, we want to check for language UB and library UB
|
||||
mir::NullOp::UbChecks => {
|
||||
let val = bx.tcx().sess.opts.debug_assertions;
|
||||
bx.cx().const_bool(val)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue