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)
| 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)] |
| 749 | pub 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 |