Skip to content

Commit

Permalink
Add #isAcAsmOperandModifier
Browse files Browse the repository at this point in the history
This commit adds `#isAcAsmOperandModifier` in order to replace
`#isKindOf:`.
  • Loading branch information
janvrany authored and shingarov committed Sep 4, 2024
1 parent 8825555 commit 9f4884c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/ArchC-Core/AcAsmOperandModifier.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ AcAsmOperandModifier >> encodeInFields: fs accordingTo: format [
self subclassResponsibility
]

{ #category : #testing }
AcAsmOperandModifier >> isAcAsmOperandModifier [
^ true
]

{ #category : #queries }
AcAsmOperandModifier >> isPRREL [
^ self class isPCREL
Expand Down
8 changes: 5 additions & 3 deletions src/ArchC-Core/AsmOperandInstantiation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ AsmOperandInstantiation >> encodeSimpleValue: value [

{ #category : #private }
AsmOperandInstantiation >> encodeValue: value accoringTo: format [
(value isKindOf: AcAsmOperandModifier) ifTrue: [ ^value encodeInFields: self accordingTo: format ].
^self encodeSimpleValue: value

value isAcAsmOperandModifier ifTrue: [
^ value encodeInFields: self accordingTo: format
] ifFalse: [
^ self encodeSimpleValue: value
]
]

{ #category : #rewriting }
Expand Down
5 changes: 5 additions & 0 deletions src/ArchC-Core/Object.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ Extension { #name : #Object }
Object >> decodeFor: anISA [
^(anISA decodeableFormFor: self) decodeFor: anISA
]

{ #category : #'*ArchC-Core' }
Object >> isAcAsmOperandModifier [
^ false
]

0 comments on commit 9f4884c

Please sign in to comment.