Skip to content

Commit

Permalink
Remove duplicated methods from OCAbstractVariable and subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
dionisiydk committed Jun 18, 2020
1 parent e12c31e commit 2c7ed5e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 131 deletions.
12 changes: 12 additions & 0 deletions src/Kernel/Variable.class.st
Expand Up @@ -58,6 +58,18 @@ Variable >> = other [
and: [ name = other name ]
]

{ #category : #'code generation' }
Variable >> emitStore: methodBuilder [

self subclassResponsibility
]

{ #category : #'code generation' }
Variable >> emitValue: methodBuilder [

self subclassResponsibility
]

{ #category : #properties }
Variable >> ensureProperties [
^ Properties at: self ifAbsentPut: WeakKeyDictionary new
Expand Down
11 changes: 0 additions & 11 deletions src/OpalCompiler-Core/OCAbstractLocalVariable.class.st
Expand Up @@ -21,14 +21,3 @@ OCAbstractLocalVariable >> isUninitialized [

^ self isWrite not
]

{ #category : #accessing }
OCAbstractLocalVariable >> name [

^ name
]

{ #category : #initializing }
OCAbstractLocalVariable >> name: string [
name := string
]
120 changes: 0 additions & 120 deletions src/OpalCompiler-Core/OCAbstractVariable.class.st
Expand Up @@ -11,11 +11,6 @@ Class {
#category : #'OpalCompiler-Core-Semantics'
}

{ #category : #accessing }
OCAbstractVariable class >> semanticNodeClass [
self subclassResponsibility
]

{ #category : #converting }
OCAbstractVariable >> asString [

Expand All @@ -27,50 +22,6 @@ OCAbstractVariable >> definingScope [
^ scope
]

{ #category : #emitting }
OCAbstractVariable >> emitStore: methodBuilder [

self subclassResponsibility
]

{ #category : #emitting }
OCAbstractVariable >> emitValue: methodBuilder [

self subclassResponsibility
]

{ #category : #testing }
OCAbstractVariable >> isArg [
^false
]

{ #category : #testing }
OCAbstractVariable >> isClassVariable [
^ false
]

{ #category : #testing }
OCAbstractVariable >> isGlobal [

^ false
]

{ #category : #testing }
OCAbstractVariable >> isGlobalVariable [
^ false
]

{ #category : #testing }
OCAbstractVariable >> isInstance [
^false

]

{ #category : #testing }
OCAbstractVariable >> isLiteralVariable [
^false
]

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

Expand All @@ -94,62 +45,13 @@ OCAbstractVariable >> isRepeatedWrite [

]

{ #category : #testing }
OCAbstractVariable >> isSelf [
^false
]

{ #category : #testing }
OCAbstractVariable >> isSelfOrSuper [

^ false
]

{ #category : #testing }
OCAbstractVariable >> isSpecialVariable [
^false
]

{ #category : #testing }
OCAbstractVariable >> isSuper [
^false
]

{ #category : #testing }
OCAbstractVariable >> isTemp [

^ false
]

{ #category : #testing }
OCAbstractVariable >> isThisContext [
^false
]

{ #category : #testing }
OCAbstractVariable >> isUndeclared [

^ false
]

{ #category : #'read/write usage' }
OCAbstractVariable >> isUninitialized [

^ false
]

{ #category : #'read/write usage' }
OCAbstractVariable >> isUnused [
"when the var is never read or written, it is not used.
Note: we have a special #arg use which means arguments are never unused"
^ usage isNil
]

{ #category : #testing }
OCAbstractVariable >> isWritable [
^ true
]

{ #category : #'read/write usage' }
OCAbstractVariable >> isWrite [
^ usage = #write or: [ self isRepeatedWrite ]
Expand All @@ -174,17 +76,6 @@ OCAbstractVariable >> markWrite [
usage := #write.
]

{ #category : #accessing }
OCAbstractVariable >> name [

^ self subclassResponsibility
]

{ #category : #accessing }
OCAbstractVariable >> originalVar [
^ self
]

{ #category : #printing }
OCAbstractVariable >> printOn: stream [

Expand All @@ -203,11 +94,6 @@ OCAbstractVariable >> scope: aLexicalScope [
scope := aLexicalScope
]

{ #category : #accessing }
OCAbstractVariable >> semanticNodeClass [
^self class semanticNodeClass
]

{ #category : #accessing }
OCAbstractVariable >> usage [

Expand All @@ -219,9 +105,3 @@ OCAbstractVariable >> usage: anObject [

usage := anObject
]

{ #category : #accessing }
OCAbstractVariable >> variable [
"I return the first class variable that I model in the case of globals and ivars"
^self
]

0 comments on commit 2c7ed5e

Please sign in to comment.