Browse Source

* converted tai directive string from pshortstring to ansistring (some
AIX directives are quite long)

git-svn-id: trunk@20799 -

Jonas Maebe 13 years ago
parent
commit
aaf6015b51
5 changed files with 16 additions and 24 deletions
  1. 6 13
      compiler/aasmtai.pas
  2. 2 2
      compiler/aggas.pas
  3. 4 4
      compiler/assemble.pas
  4. 1 2
      compiler/x86/agx86int.pas
  5. 3 3
      compiler/x86/agx86nsm.pas

+ 6 - 13
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;
 

+ 2 - 2
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;
 

+ 4 - 4
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 }

+ 1 - 2
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 :

+ 3 - 3
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;