summaryrefslogtreecommitdiff
path: root/compiler/jvm
diff options
context:
space:
mode:
authoryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-08-22 19:53:39 +0000
committeryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-08-22 19:53:39 +0000
commit2c128acf576dd9eef30e9256f127ad8cc4c9db2c (patch)
tree9d10fd484639d317393d42f1953215cbd93b963b /compiler/jvm
parentf63b00bacfe9e81a38a0168adc866976de9fac25 (diff)
downloadfpc-2c128acf576dd9eef30e9256f127ad8cc4c9db2c.tar.gz
* ait_comment,ait_regalloc,ait_tempalloc,ait_varloc instructions produce only comments in the external assembler output. Moved handling of these instructions to TExternalAssembler.WriteComments().
This eliminates code duplication and improves maintainability. git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@46550 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/jvm')
-rw-r--r--compiler/jvm/agjasmin.pas44
1 files changed, 2 insertions, 42 deletions
diff --git a/compiler/jvm/agjasmin.pas b/compiler/jvm/agjasmin.pas
index ca039256bc..bdffd19a25 100644
--- a/compiler/jvm/agjasmin.pas
+++ b/compiler/jvm/agjasmin.pas
@@ -362,47 +362,6 @@ implementation
case hp.typ of
- ait_comment :
- Begin
- writer.AsmWrite(asminfo^.comment);
- writer.AsmWritePChar(tai_comment(hp).str);
- writer.AsmLn;
- End;
-
- ait_regalloc :
- begin
- if (cs_asm_regalloc in current_settings.globalswitches) then
- begin
- writer.AsmWrite(#9+asminfo^.comment+'Register ');
- repeat
- writer.AsmWrite(std_regname(Tai_regalloc(hp).reg));
- if (hp.next=nil) or
- (tai(hp.next).typ<>ait_regalloc) or
- (tai_regalloc(hp.next).ratype<>tai_regalloc(hp).ratype) then
- break;
- hp:=tai(hp.next);
- writer.AsmWrite(',');
- until false;
- writer.AsmWrite(' ');
- writer.AsmWriteLn(regallocstr[tai_regalloc(hp).ratype]);
- end;
- end;
-
- ait_tempalloc :
- begin
- if (cs_asm_tempalloc in current_settings.globalswitches) then
- begin
- {$ifdef EXTDEBUG}
- if assigned(tai_tempalloc(hp).problem) then
- writer.AsmWriteLn(asminfo^.comment+'Temp '+tostr(tai_tempalloc(hp).temppos)+','+
- tostr(tai_tempalloc(hp).tempsize)+' '+tai_tempalloc(hp).problem^)
- else
- {$endif EXTDEBUG}
- writer.AsmWriteLn(asminfo^.comment+'Temp '+tostr(tai_tempalloc(hp).temppos)+','+
- tostr(tai_tempalloc(hp).tempsize)+' '+tempallocstr[tai_tempalloc(hp).allocation]);
- end;
- end;
-
ait_align :
begin
@@ -538,7 +497,8 @@ implementation
writer.AsmWriteLn(tai_jcatch(hp).handlerlab.name);
end;
else
- internalerror(2010122707);
+ if not WriteComments(hp) then
+ internalerror(2010122707);
end;
hp:=tai(hp.next);
end;