From aaf6015b511a39979e8da30c20b6fc9a952e0146 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 11 Apr 2012 18:01:41 +0000 Subject: [PATCH] * converted tai directive string from pshortstring to ansistring (some AIX directives are quite long) git-svn-id: trunk@20799 - --- compiler/aasmtai.pas | 19 ++++++------------- compiler/aggas.pas | 4 ++-- compiler/assemble.pas | 8 ++++---- compiler/x86/agx86int.pas | 3 +-- compiler/x86/agx86nsm.pas | 6 +++--- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index 7b511a8b2b..57958511f1 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -377,10 +377,9 @@ interface end; tai_directive = class(tailineinfo) - name : pshortstring; + name : ansistring; directive : TAsmDirective; - constructor Create(_directive:TAsmDirective;const _name:string); - destructor Destroy;override; + constructor Create(_directive:TAsmDirective;const _name:ansistring); constructor ppuload(t:taitype;ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override; end; @@ -1154,25 +1153,19 @@ implementation TAI_SYMBOL_END ****************************************************************************} - constructor tai_directive.Create(_directive:TAsmDirective;const _name:string); + constructor tai_directive.Create(_directive:TAsmDirective;const _name:ansistring); begin inherited Create; typ:=ait_directive; - name:=stringdup(_name); + name:=_name; directive:=_directive; end; - destructor tai_directive.Destroy; - begin - stringdispose(name); - end; - - constructor tai_directive.ppuload(t:taitype;ppufile:tcompilerppufile); begin inherited ppuload(t,ppufile); - name:=stringdup(ppufile.getstring); + name:=ppufile.getansistring; directive:=TAsmDirective(ppufile.getbyte); end; @@ -1180,7 +1173,7 @@ implementation procedure tai_directive.ppuwrite(ppufile:tcompilerppufile); begin inherited ppuwrite(ppufile); - ppufile.putstring(name^); + ppufile.putansistring(name); ppufile.putbyte(byte(directive)); end; diff --git a/compiler/aggas.pas b/compiler/aggas.pas index ebf660ed50..f2c727c511 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -1230,8 +1230,8 @@ implementation ait_directive : begin AsmWrite('.'+directivestr[tai_directive(hp).directive]+' '); - if assigned(tai_directive(hp).name) then - AsmWrite(tai_directive(hp).name^); + if tai_directive(hp).name <>'' then + AsmWrite(tai_directive(hp).name); AsmLn; end; diff --git a/compiler/assemble.pas b/compiler/assemble.pas index dbb564c995..b5d864685a 100644 --- a/compiler/assemble.pas +++ b/compiler/assemble.pas @@ -1155,9 +1155,9 @@ Implementation ; asd_lazy_reference: begin - if tai_directive(hp).name = nil then + if tai_directive(hp).name='' then Internalerror(2009112101); - objsym:=ObjData.symbolref(tai_directive(hp).name^); + objsym:=ObjData.symbolref(tai_directive(hp).name); objsym.bind:=AB_LAZY; end; asd_reference: @@ -1292,9 +1292,9 @@ Implementation begin case tai_directive(hp).directive of asd_indirect_symbol: - if tai_directive(hp).name = nil then + if tai_directive(hp).name='' then Internalerror(2009101103) - else if not SetIndirectToSymbol(Tai(hp.Previous), tai_directive(hp).name^) then + else if not SetIndirectToSymbol(Tai(hp.Previous), tai_directive(hp).name) then Internalerror(2009101102); asd_lazy_reference: { handled in TreePass0 } diff --git a/compiler/x86/agx86int.pas b/compiler/x86/agx86int.pas index 3b9661ccdf..bcfcb341e4 100644 --- a/compiler/x86/agx86int.pas +++ b/compiler/x86/agx86int.pas @@ -839,8 +839,7 @@ implementation else internalerror(200509192); end; - if assigned(tai_directive(hp).name) then - AsmWrite(tai_directive(hp).name^); + AsmWrite(tai_directive(hp).name); AsmLn; end; ait_seh_directive : diff --git a/compiler/x86/agx86nsm.pas b/compiler/x86/agx86nsm.pas index 70c96e7493..a57ccf463b 100644 --- a/compiler/x86/agx86nsm.pas +++ b/compiler/x86/agx86nsm.pas @@ -963,13 +963,13 @@ interface else internalerror(200509191); end; - if assigned(tai_directive(hp).name) then + if tai_directive(hp).name<>'' then begin if SmartAsm then - AddSymbol(tai_directive(hp).name^,false); + AddSymbol(tai_directive(hp).name,false); - AsmWrite(tai_directive(hp).name^); + AsmWrite(tai_directive(hp).name); end; AsmLn; end;