@@ -4,7 +4,6 @@ use crate::cilnode::MethodKind;
44use crate :: v2:: method:: LocalDef ;
55
66use crate :: FieldDesc ;
7- use crate :: IntoAsmIndex ;
87use crate :: {
98 call,
109 cil_root:: CILRoot ,
@@ -27,12 +26,7 @@ pub enum CILNode {
2726 V2 ( Interned < crate :: v2:: CILNode > ) ,
2827 /// Loads the value of local variable number `n`.
2928 LDLoc ( u32 ) ,
30- /// Loads the value of argument number `n`.
31- LDArg ( u32 ) ,
32- /// Loads the address of local variable number `n`.
33- LDLocA ( u32 ) ,
34- /// Loads the address of argument number `n`.
35- LDArgA ( u32 ) ,
29+
3630 /// A black box that prevents the bulit-in optimization engine from doing any optimizations.
3731 BlackBox ( Box < Self > ) ,
3832 /// Loads the value of a static variable described by the descripstor.
@@ -136,7 +130,7 @@ pub enum CILNode {
136130 CallVirt ( Box < CallOpArgs > ) ,
137131 LdcF64 ( HashableF64 ) ,
138132 LdcF32 ( HashableF32 ) ,
139-
133+
140134 ConvU8 ( Box < Self > ) ,
141135 ConvU16 ( Box < Self > ) ,
142136 ConvU32 ( Box < Self > ) ,
@@ -160,8 +154,7 @@ pub enum CILNode {
160154 Gt ( Box < Self > , Box < Self > ) ,
161155 /// Compares two operands, returning true if lhs < rhs. Unsigned for intigers, unordered(in respect to NaNs) for floats.
162156 GtUn ( Box < Self > , Box < Self > ) ,
163- LoadAddresOfTMPLocal ,
164- LoadTMPLocal ,
157+
165158 LDFtn ( Interned < MethodRef > ) ,
166159 LDTypeToken ( Box < Type > ) ,
167160 NewObj ( Box < CallOpArgs > ) ,
@@ -374,7 +367,7 @@ impl CILNode {
374367 destination_addr : Self ,
375368 val_desc : Interned < FieldDesc > ,
376369 flag_desc : Interned < FieldDesc > ,
377- ) -> [ CILRoot ; 2 ] {
370+ ) -> [ CILRoot ; 2 ] {
378371 // Set the value of the result.
379372 let set_val = CILRoot :: SetField {
380373 addr : Box :: new ( destination_addr. clone ( ) ) ,
@@ -385,16 +378,18 @@ impl CILNode {
385378 let val = CILNode :: LDField {
386379 addr : Box :: new ( destination_addr. clone ( ) ) ,
387380 field : val_desc,
388- }
389- ;
381+ } ;
390382
391383 let cmp = CILNode :: Eq ( val. into ( ) , expected. into ( ) ) ;
392384
393- [ set_val, CILRoot :: SetField {
394- addr : Box :: new ( destination_addr. clone ( ) ) ,
395- value : Box :: new ( cmp) ,
396- desc : flag_desc,
397- } ]
385+ [
386+ set_val,
387+ CILRoot :: SetField {
388+ addr : Box :: new ( destination_addr. clone ( ) ) ,
389+ value : Box :: new ( cmp) ,
390+ desc : flag_desc,
391+ } ,
392+ ]
398393 }
399394 #[ track_caller]
400395 pub fn cast_ptr ( self , new_ptr : Type ) -> Self {
@@ -427,11 +422,8 @@ impl CILNode {
427422 Self :: GetException =>( ) ,
428423 Self :: LocAlloc { ..} =>( ) ,
429424 Self :: LocAllocAligned { ..} =>( ) ,
430- Self :: CastPtr { val, new_ptr : _ } =>val. allocate_tmps ( curr_loc, locals) ,
431- Self :: LDLoc ( _) |
432- Self :: LDArg ( _) |
433- Self :: LDLocA ( _) |
434- Self :: LDArgA ( _) => ( ) ,
425+ Self :: CastPtr { val, new_ptr : _ } =>val. allocate_tmps ( curr_loc, locals) ,
426+ Self :: LDLoc ( _) => ( ) ,
435427 Self :: BlackBox ( inner) => inner. allocate_tmps ( curr_loc, locals) ,
436428 Self :: LDIndI8 { ptr } |
437429 Self :: LDIndBool { ptr } |
@@ -494,10 +486,6 @@ impl CILNode {
494486 //Self::Volatile(_) => todo!(),
495487 Self :: Neg ( val) |
496488 Self :: Not ( val) =>val. allocate_tmps ( curr_loc, locals) ,
497-
498-
499- Self :: LoadAddresOfTMPLocal => * self = Self :: LDLocA ( curr_loc. expect ( "Temporary local referenced when none present" ) ) ,
500- Self :: LoadTMPLocal =>* self = Self :: LDLoc ( curr_loc. expect ( "Temporary local referenced when none present" ) ) ,
501489 Self :: LDFtn ( _) => ( ) ,
502490 Self :: LDTypeToken ( _) =>( ) ,
503491
0 commit comments