From e7f0b62593f605259acc82f49a54ccdcc209de3c Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Sat, 20 Apr 2024 12:35:36 -0700 Subject: [PATCH] Remove some dead compiler code. --- newspeak/Mirrors.ns | 6 +-- .../Newspeak2PrimordialSoupCompilation.ns | 42 +------------------ 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/newspeak/Mirrors.ns b/newspeak/Mirrors.ns index 0e8671b..0717bb8 100644 --- a/newspeak/Mirrors.ns +++ b/newspeak/Mirrors.ns @@ -76,12 +76,12 @@ private computeDebugInfo = ( definingMixin _nestedMixins do: [:nestedMixin | nestedMixin _name = rawMethod selector ifTrue: [^(compiler - compileClassHeader2: nestedMixin _headerSource + compileClassHeader: nestedMixin _headerSource within: (mxn: definingMixin)) accessor debugInfo]]. (* Instance initializer *) (isSubinitializerSelector: rawMethod selector) ifTrue: [^(compiler - compileClassHeader2: rawMethod mixin _headerSource + compileClassHeader: rawMethod mixin _headerSource within: (mxn: definingMixin _enclosingMixin)) initializers first debugInfo]. (* Transient slot getter / setter / initializer *) definingMixin _slots do: @@ -109,7 +109,7 @@ private computeDebugInfo = ( definingMixin isMeta ifTrue: [definingMixin _instanceMixin _primaryFactorySelector = rawMethod selector ifTrue: [^(compiler - compileClassHeader2: definingMixin _instanceMixin _headerSource + compileClassHeader: definingMixin _instanceMixin _headerSource within: (mxn: definingMixin _enclosingMixin)) factory debugInfo]]. panic. diff --git a/newspeak/Newspeak2PrimordialSoupCompilation.ns b/newspeak/Newspeak2PrimordialSoupCompilation.ns index 27219ed..4f355e6 100644 --- a/newspeak/Newspeak2PrimordialSoupCompilation.ns +++ b/newspeak/Newspeak2PrimordialSoupCompilation.ns @@ -2058,24 +2058,6 @@ private compileClass: node ^ ^classDecl ) -public compileClassHeader2: src within: enclosing ^ = ( - | tree intermediate | - - currentSource:: src. - currentScope:: Scope new. - currentDepth:: 0. - - nil = enclosing ifFalse: [buildIncrementalScopeFor: enclosing]. - tree:: parseClassDeclaration: src , '()'. - - toScope: currentScope addClass: tree. - - nil = enclosing - ifTrue: [intermediate:: compileClass: tree] - ifFalse: [intermediate:: within: enclosing compileClassNoAdd: tree]. - - ^intermediate -) public compileClassHeader: source within: enclosingIR = ( ^compileClassSource: (source, '()') within: enclosingIR ) @@ -2086,7 +2068,7 @@ public compileClassSource: src within: enclosingIR currentScope:: Scope new. currentDepth:: 0. - nil = enclosingIR ifFalse: [buildIncrementalScopeFor: enclosingIR builder]. + nil = enclosingIR ifFalse: [buildIncrementalScopeFor: enclosingIR]. tree:: parseClassDeclaration: src. toScope: currentScope addClass: tree. @@ -2471,28 +2453,6 @@ selfNode ^ = ( sourceForNode: node ^ = ( ^currentSource copyFrom: node start to: node end ) -superConstructorCallFor: aNode ^ = ( - (* create call to super constructor method *) - | - var - send - start - end - superMsg - args - | - - start:: aNode superConstructorCall start. - end:: aNode superConstructorCall end. - var:: VariableAST new name: #self; start: start; end: end. - args:: aNode constructor parameters collect: - [:p | hereSendFrom: p]. - superMsg:: MessageAST new - send: (superConstructorNameFor: aNode) with: args; - start: start; end: end. - send:: UnresolvedSendAST new to: var send: superMsg; start: start; end: end. - ^send -) superConstructorNameFor: aNode ^ = ( ^(aNode name, '`superInit`', aNode constructor selector) asSymbol )