Rollup merge of #114082 - ericmarkmartin:smir-nullary-op, r=spastorino

add stable NullaryOp

r? `@spastorino`
This commit is contained in:
Matthias Krüger 2023-07-27 06:04:14 +02:00 committed by GitHub
commit 17e4f80257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -156,7 +156,9 @@ fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
ops.0.stable(tables), ops.0.stable(tables),
ops.1.stable(tables), ops.1.stable(tables),
), ),
NullaryOp(_, _) => todo!(), NullaryOp(null_op, ty) => {
stable_mir::mir::Rvalue::NullaryOp(null_op.stable(tables), tables.intern_ty(*ty))
}
UnaryOp(un_op, op) => { UnaryOp(un_op, op) => {
stable_mir::mir::Rvalue::UnaryOp(un_op.stable(tables), op.stable(tables)) stable_mir::mir::Rvalue::UnaryOp(un_op.stable(tables), op.stable(tables))
} }

View File

@ -218,6 +218,9 @@ pub enum Rvalue {
/// nature of this operation? /// nature of this operation?
ThreadLocalRef(stable_mir::CrateItem), ThreadLocalRef(stable_mir::CrateItem),
/// Computes a value as described by the operation.
NullaryOp(NullOp, Ty),
/// Exactly like `BinaryOp`, but less operands. /// Exactly like `BinaryOp`, but less operands.
/// ///
/// Also does two's-complement arithmetic. Negation requires a signed integer or a float; /// Also does two's-complement arithmetic. Negation requires a signed integer or a float;