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 12d716a8181fc1
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
     1.1 --- a/compiler/TCompilerPass.st	Wed Sep 16 05:29:43 2015 +0100
     1.2 +++ b/compiler/TCompilerPass.st	Fri Sep 18 06:20:53 2015 +0100
     1.3 @@ -171,6 +171,16 @@
     1.4      "Created: / 02-09-2015 / 07:16:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     1.5  !
     1.6  
     1.7 +acceptSequenceNode: aSequenceNode 
     1.8 +    | last |
     1.9 +    self passByNode:aSequenceNode.
    1.10 +    self visitArguments: aSequenceNode temporaries.
    1.11 +    aSequenceNode statements do: [:each | last := self visitNode: each].
    1.12 +    ^ last
    1.13 +
    1.14 +    "Created: / 18-09-2015 / 06:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.15 +!
    1.16 +
    1.17  acceptSpecialFormNode:aTSpecialFormNode 
    1.18      aTSpecialFormNode selector = #ifTrue: ifTrue:[
    1.19          ^ self acceptIfTrueNode:aTSpecialFormNode.
     2.1 --- a/compiler/TInlineAssemblyBeginToken.st	Wed Sep 16 05:29:43 2015 +0100
     2.2 +++ b/compiler/TInlineAssemblyBeginToken.st	Fri Sep 18 06:20:53 2015 +0100
     2.3 @@ -9,6 +9,7 @@
     2.4  	category:'Languages-Tea-Compiler-AST'
     2.5  !
     2.6  
     2.7 +
     2.8  !TInlineAssemblyBeginToken methodsFor:'testing'!
     2.9  
    2.10  isTInlineAssemblyBegin
    2.11 @@ -17,3 +18,10 @@
    2.12      "Created: / 02-09-2015 / 06:20:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    2.13  ! !
    2.14  
    2.15 +!TInlineAssemblyBeginToken class methodsFor:'documentation'!
    2.16 +
    2.17 +version_HG
    2.18 +
    2.19 +    ^ '$Changeset: <not expanded> $'
    2.20 +! !
    2.21 +
     3.1 --- a/compiler/TLLVMCodeGenerator.st	Wed Sep 16 05:29:43 2015 +0100
     3.2 +++ b/compiler/TLLVMCodeGenerator.st	Fri Sep 18 06:20:53 2015 +0100
     3.3 @@ -218,10 +218,10 @@
     3.4      | value |
     3.5  
     3.6      value := self visitNode: aReturnNode value.
     3.7 -    asm ret: value.
     3.8 +    ^ asm ret: value.
     3.9  
    3.10      "Created: / 31-08-2015 / 10:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    3.11 -    "Modified: / 31-08-2015 / 12:17:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    3.12 +    "Modified: / 18-09-2015 / 06:08:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    3.13  !
    3.14  
    3.15  acceptSTXPrimitiveCCodeNode: aPrimitiveCCodeNode