Make TCompilerPass>>acceptSequenceNode: to return value of last statement.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 18 Sep 2015 06:20:53 +0100
changeset 12 d716a8181fc1
parent 11 6d39860d0fdb
child 13 97090c2baa33
Make TCompilerPass>>acceptSequenceNode: to return value of last statement. This is required for proper compilation of (inlined) blocks
compiler/TCompilerPass.st
compiler/TInlineAssemblyBeginToken.st
compiler/TLLVMCodeGenerator.st
--- a/compiler/TCompilerPass.st	Wed Sep 16 05:29:43 2015 +0100
+++ b/compiler/TCompilerPass.st	Fri Sep 18 06:20:53 2015 +0100
@@ -171,6 +171,16 @@
     "Created: / 02-09-2015 / 07:16:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+acceptSequenceNode: aSequenceNode 
+    | last |
+    self passByNode:aSequenceNode.
+    self visitArguments: aSequenceNode temporaries.
+    aSequenceNode statements do: [:each | last := self visitNode: each].
+    ^ last
+
+    "Created: / 18-09-2015 / 06:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 acceptSpecialFormNode:aTSpecialFormNode 
     aTSpecialFormNode selector = #ifTrue: ifTrue:[
         ^ self acceptIfTrueNode:aTSpecialFormNode.
--- a/compiler/TInlineAssemblyBeginToken.st	Wed Sep 16 05:29:43 2015 +0100
+++ b/compiler/TInlineAssemblyBeginToken.st	Fri Sep 18 06:20:53 2015 +0100
@@ -9,6 +9,7 @@
 	category:'Languages-Tea-Compiler-AST'
 !
 
+
 !TInlineAssemblyBeginToken methodsFor:'testing'!
 
 isTInlineAssemblyBegin
@@ -17,3 +18,10 @@
     "Created: / 02-09-2015 / 06:20:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!TInlineAssemblyBeginToken class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/TLLVMCodeGenerator.st	Wed Sep 16 05:29:43 2015 +0100
+++ b/compiler/TLLVMCodeGenerator.st	Fri Sep 18 06:20:53 2015 +0100
@@ -218,10 +218,10 @@
     | value |
 
     value := self visitNode: aReturnNode value.
-    asm ret: value.
+    ^ asm ret: value.
 
     "Created: / 31-08-2015 / 10:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 31-08-2015 / 12:17:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-09-2015 / 06:08:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 acceptSTXPrimitiveCCodeNode: aPrimitiveCCodeNode