Browse Source

* Removed tasmdata.realname (it is not used anywhere) and changed tasmdata.name to pshortstring. The name string is owned by tmodule and referenced by tasmdata. This removes 80-char limit on tasmdata.name, Mantis #25009.

git-svn-id: trunk@25523 -
sergei 12 years ago
parent
commit
d25330e367
3 changed files with 11 additions and 14 deletions
  1. 7 9
      compiler/aasmdata.pas
  2. 3 4
      compiler/fmodule.pas
  3. 1 1
      compiler/powerpc64/cgcpu.pas

+ 7 - 9
compiler/aasmdata.pas

@@ -155,15 +155,14 @@ interface
         FConstPools    : array[TConstPoolType] of THashSet;
         FConstPools    : array[TConstPoolType] of THashSet;
         function GetConstPools(APoolType: TConstPoolType): THashSet;
         function GetConstPools(APoolType: TConstPoolType): THashSet;
       public
       public
-        name,
-        realname      : string[80];
+        name          : pshortstring;       { owned by tmodule }
         NextVTEntryNr : longint;
         NextVTEntryNr : longint;
         { Assembler lists }
         { Assembler lists }
         AsmLists      : array[TAsmListType] of TAsmList;
         AsmLists      : array[TAsmListType] of TAsmList;
         CurrAsmList   : TAsmList;
         CurrAsmList   : TAsmList;
         WideInits     : TLinkedList;
         WideInits     : TLinkedList;
         ResStrInits   : TLinkedList;
         ResStrInits   : TLinkedList;
-        constructor create(const n:string);
+        constructor create(n: pshortstring);
         destructor  destroy;override;
         destructor  destroy;override;
         { asmsymbol }
         { asmsymbol }
         function  DefineAsmSymbolByClass(symclass: TAsmSymbolClass; const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
         function  DefineAsmSymbolByClass(symclass: TAsmSymbolClass; const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
@@ -343,14 +342,13 @@ implementation
         Result := FConstPools[APoolType];
         Result := FConstPools[APoolType];
       end;
       end;
 
 
-    constructor TAsmData.create(const n:string);
+    constructor TAsmData.create(n:pshortstring);
       var
       var
         alt : TAsmLabelType;
         alt : TAsmLabelType;
         hal : TAsmListType;
         hal : TAsmListType;
       begin
       begin
         inherited create;
         inherited create;
-        realname:=n;
-        name:=upper(n);
+        name:=n;
         { symbols }
         { symbols }
         FAsmSymbolDict:=TFPHashObjectList.create(true);
         FAsmSymbolDict:=TFPHashObjectList.create(true);
         FAltSymbolList:=TFPObjectList.Create(false);
         FAltSymbolList:=TFPObjectList.Create(false);
@@ -494,7 +492,7 @@ implementation
              but if we create_smartlink_sections, this is useless }
              but if we create_smartlink_sections, this is useless }
            (create_smartlink_library) and
            (create_smartlink_library) and
            (alt = alt_dbgline) then
            (alt = alt_dbgline) then
-          l:=TAsmLabel.createglobal(AsmSymbolDict,name,FNextLabelNr[alt],alt)
+          l:=TAsmLabel.createglobal(AsmSymbolDict,name^,FNextLabelNr[alt],alt)
         else
         else
           l:=TAsmLabel.createlocal(AsmSymbolDict,FNextLabelNr[alt],alt);
           l:=TAsmLabel.createlocal(AsmSymbolDict,FNextLabelNr[alt],alt);
         inc(FNextLabelNr[alt]);
         inc(FNextLabelNr[alt]);
@@ -509,13 +507,13 @@ implementation
 
 
     procedure TAsmData.getglobaljumplabel(out l : TAsmLabel);
     procedure TAsmData.getglobaljumplabel(out l : TAsmLabel);
       begin
       begin
-        l:=TAsmLabel.createglobal(AsmSymbolDict,name,FNextLabelNr[alt_jump],alt_jump);
+        l:=TAsmLabel.createglobal(AsmSymbolDict,name^,FNextLabelNr[alt_jump],alt_jump);
         inc(FNextLabelNr[alt_jump]);
         inc(FNextLabelNr[alt_jump]);
       end;
       end;
 
 
     procedure TAsmData.getdatalabel(out l : TAsmLabel);
     procedure TAsmData.getdatalabel(out l : TAsmLabel);
       begin
       begin
-        l:=TAsmLabel.createglobal(AsmSymbolDict,name,FNextLabelNr[alt_data],alt_data);
+        l:=TAsmLabel.createglobal(AsmSymbolDict,name^,FNextLabelNr[alt_data],alt_data);
         inc(FNextLabelNr[alt_data]);
         inc(FNextLabelNr[alt_data]);
       end;
       end;
 
 

+ 3 - 4
compiler/fmodule.pas

@@ -580,7 +580,7 @@ implementation
         tcinitcode:=nil;
         tcinitcode:=nil;
         _exports:=TLinkedList.Create;
         _exports:=TLinkedList.Create;
         dllscannerinputlist:=TFPHashList.Create;
         dllscannerinputlist:=TFPHashList.Create;
-        asmdata:=casmdata.create(realmodulename^);
+        asmdata:=casmdata.create(modulename);
         InitDebugInfo(self,false);
         InitDebugInfo(self,false);
       end;
       end;
 
 
@@ -750,7 +750,7 @@ implementation
         derefdataintflen:=0;
         derefdataintflen:=0;
         sourcefiles.free;
         sourcefiles.free;
         sourcefiles:=tinputfilemanager.create;
         sourcefiles:=tinputfilemanager.create;
-        asmdata:=casmdata.create(realmodulename^);
+        asmdata:=casmdata.create(modulename);
         InitDebugInfo(self,current_debuginfo_reset);
         InitDebugInfo(self,current_debuginfo_reset);
         _exports.free;
         _exports.free;
         _exports:=tlinkedlist.create;
         _exports:=tlinkedlist.create;
@@ -1024,8 +1024,7 @@ implementation
         modulename:=stringdup(upper(s));
         modulename:=stringdup(upper(s));
         realmodulename:=stringdup(s);
         realmodulename:=stringdup(s);
         { also update asmlibrary names }
         { also update asmlibrary names }
-        current_asmdata.name:=modulename^;
-        current_asmdata.realname:=realmodulename^;
+        current_asmdata.name:=modulename;
       end;
       end;
 
 
 
 

+ 1 - 1
compiler/powerpc64/cgcpu.pas

@@ -1965,7 +1965,7 @@ var
   symname : string;
   symname : string;
 begin
 begin
   maybe_new_object_file(current_asmdata.asmlists[al_picdata]);
   maybe_new_object_file(current_asmdata.asmlists[al_picdata]);
-  symname := '_$' + current_asmdata.name + '$toc$' + hexstr(a, sizeof(a)*2);
+  symname := '_$' + current_asmdata.name^ + '$toc$' + hexstr(a, sizeof(a)*2);
   l:=current_asmdata.getasmsymbol(symname);
   l:=current_asmdata.getasmsymbol(symname);
   if not(assigned(l)) then begin
   if not(assigned(l)) then begin
     l:=current_asmdata.DefineAsmSymbol(symname,AB_GLOBAL, AT_DATA);
     l:=current_asmdata.DefineAsmSymbol(symname,AB_GLOBAL, AT_DATA);