MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / zero_for_operand

Method zero_for_operand

src/oomir.rs:736–764  ·  view source on GitHub ↗

Helper to get a zero constant of a type compatible with an operand there's NO Integer, Float type use I8, F32, F64 etc. etc.

(op: &Operand)

Source from the content-addressed store, hash-verified

734 pub fn get_name(&self) -> Option<&str> {
735 match self {
736 Operand::Variable { name, .. } => Some(name),
737 _ => None,
738 }
739 }
740 pub fn get_type(&self) -> Option<Type> {
741 match self {
742 Operand::Variable { ty, .. } => Some(ty.clone()),
743 Operand::Constant(c) => Some(Type::from_constant(c)),
744 }
745 }
746}
747
748#[derive(Debug, Clone, PartialEq)]
749pub enum Constant {
750 Unit,
751 StaticRef {
752 owner_class: String,
753 field_name: String,
754 ty: Type,
755 },
756 FunctionPointer {
757 adapter_class: String,
758 interface_name: String,
759 },
760 /// A lower2-generated call to a private factory method. Large static object
761 /// graphs use these to stay within the JVM's per-method bytecode limit.
762 FactoryCall {
763 owner_class: String,
764 method_name: String,
765 ty: Type,
766 },
767 /// A call to a generated pure helper used to construct a constant whose

Callers

nothing calls this directly

Calls 2

F32Class · 0.85
F64Class · 0.85

Tested by

no test coverage detected