Browse Source

More mx2cc deps tweaks and rebuilt mx2cc_windows.

Mark Sibly 8 năm trước cách đây
mục cha
commit
4e2a0e5a60
2 tập tin đã thay đổi với 15 bổ sung11 xóa
  1. BIN
      bin/mx2cc_windows.exe
  2. 15 11
      src/mx2cc/translator_cpp.monkey2

BIN
bin/mx2cc_windows.exe


+ 15 - 11
src/mx2cc/translator_cpp.monkey2

@@ -1302,6 +1302,19 @@ Class Translator_CPP Extends Translator
 
 	End
 	
+	Method AssignsTo( type:Type )
+		
+		Uses( type )
+
+		Local ctype:=TCast<ClassType>( type )
+		If ctype And ctype.IsStruct
+			For Local vvar:=Eachin ctype.fields
+				AssignsTo( vvar.type )
+			Next
+		Endif
+		
+	End
+	
 	Method EmitStmt( stmt:AssignStmt )
 	
 		Local op:=stmt.op
@@ -1315,20 +1328,11 @@ Class Translator_CPP Extends Translator
 			If vvar And vvar.vdecl.kind="param" FindGCTmp( vvar )
 		End
 		
+		AssignsTo( stmt.lhs.type )
+		
 		Local lhs:=Trans( stmt.lhs )
 		Local rhs:=Trans( stmt.rhs )
 		
-		Local type:=stmt.lhs.type
-		
-		Uses( type )
-		
-		Local ctype:=TCast<ClassType>( type )
-		If ctype And ctype.IsStruct
-			For Local vvar:=Eachin ctype.fields
-				If IsGCType( vvar.type ) Marks( vvar.type )
-			Next
-		Endif
-		
 		Emit( lhs+op+rhs+";" )
 	End