Skip to content

Commit

Permalink
- add deprecated versions of OCArgumentVariable and OCTempVariable
Browse files Browse the repository at this point in the history
- do not use #isLocal in Slot but instead implement isDefinedByOwningClass

I have not changed the senders of #isLocalVariable as maybe on the level of the Variables, we could keep the isXVariable checks... I guess we will get a better feel for that when we unify
with the node level.
  • Loading branch information
MarcusDenker committed Jul 6, 2020
1 parent 516f1f2 commit 2fbe3de
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/Deprecated90/OCArgumentVariable.class.st
@@ -0,0 +1,5 @@
Class {
#name : #OCArgumentVariable,
#superclass : #ArgumentVariable,
#category : #'Deprecated90-OpalCompiler-Core'
}
5 changes: 5 additions & 0 deletions src/Deprecated90/OCTempVariable.class.st
@@ -0,0 +1,5 @@
Class {
#name : #OCTempVariable,
#superclass : #TemporaryVariable,
#category : #'Deprecated90-OpalCompiler-Core'
}
2 changes: 1 addition & 1 deletion src/Kernel/ClassDescription.class.st
Expand Up @@ -875,7 +875,7 @@ ClassDescription >> linesOfCode [
{ #category : #slots }
ClassDescription >> localSlots [

^ self slots select: [ :aSlot | aSlot isLocal ]
^ self slots select: [ :aSlot | aSlot isDefinedByOwningClass ]
]

{ #category : #'accessing tags' }
Expand Down
10 changes: 5 additions & 5 deletions src/Kernel/Slot.class.st
Expand Up @@ -212,14 +212,14 @@ Slot >> isAccessedIn: aCompiledCode [
]

{ #category : #testing }
Slot >> isInstance [
^ true
Slot >> isDefinedByOwningClass [

^ self owningClass = self definingClass
]

{ #category : #testing }
Slot >> isLocal [

^ self owningClass = self definingClass
Slot >> isInstance [
^ true
]

{ #category : #testing }
Expand Down
5 changes: 5 additions & 0 deletions src/Kernel/Variable.class.st
Expand Up @@ -124,6 +124,11 @@ Variable >> isLiteralVariable [
^false
]

{ #category : #testing }
Variable >> isLocal [
^false
]

{ #category : #testing }
Variable >> isLocalVariable [
^false
Expand Down
2 changes: 1 addition & 1 deletion src/Shift-ClassBuilder/ShLayoutDefinition.class.st
Expand Up @@ -59,7 +59,7 @@ ShLayoutDefinition >> copy: slotCollection ifUsedIn: aClass [
ShLayoutDefinition >> copyClassSlotsIfNeeded: oldSlots [

classSlots ifNotNil: [ ^ self ].
classSlots := (oldSlots select: #isLocal thenCollect: [ :e | e copy index: nil; yourself ])
classSlots := (oldSlots select: #isDefinedByOwningClass thenCollect: [ :e | e copy index: nil; yourself ])
]

{ #category : #accessing }
Expand Down

0 comments on commit 2fbe3de

Please sign in to comment.