summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-02-01 15:06:24 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-02-01 15:06:24 +0000
commit79174073df7652bf19c57c626c7de44fd510f9b6 (patch)
tree889f35af1a0acda08b4a06b794cf63bd38abf74a
parent09bcd32afff8e7c54f4c35d33ea3ed4f2722f4c6 (diff)
downloadfpc-79174073df7652bf19c57c626c7de44fd510f9b6.tar.gz
Merged revision(s) 44072-44074 from trunk:
* have the module keep track whether it was loaded from a PPU with a different endianess than the current host system ........ * for deciding whether to swap a generic's buffer use the module's flag instead of the def's ........ - remove generic_buf_needs_swapping again as that is now handled with tmodule.change_endian of the generic's module ........ git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_2@44080 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/fmodule.pas2
-rw-r--r--compiler/fppu.pas1
-rw-r--r--compiler/pgenutil.pas6
-rw-r--r--compiler/symdef.pas3
4 files changed, 6 insertions, 6 deletions
diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas
index c2dce8b017..f3ca3a799a 100644
--- a/compiler/fmodule.pas
+++ b/compiler/fmodule.pas
@@ -131,6 +131,7 @@ interface
flags : cardinal; { the PPU flags }
islibrary : boolean; { if it is a library (win32 dll) }
IsPackage : boolean;
+ change_endian : boolean; { if the unit is loaded on a system with a different endianess than it was compiled on }
moduleid : longint;
unitmap : punitmap; { mapping of all used units }
unitmapsize : longint; { number of units in the map }
@@ -618,6 +619,7 @@ implementation
is_unit:=_is_unit;
islibrary:=false;
ispackage:=false;
+ change_endian:=false;
is_dbginfo_written:=false;
mode_switch_allowed:= true;
moduleoptions:=[];
diff --git a/compiler/fppu.pas b/compiler/fppu.pas
index acff8e0528..8d8ed4a230 100644
--- a/compiler/fppu.pas
+++ b/compiler/fppu.pas
@@ -339,6 +339,7 @@ var
crc:=ppufile.header.checksum;
interface_crc:=ppufile.header.interface_checksum;
indirect_crc:=ppufile.header.indirect_checksum;
+ change_endian:=ppufile.change_endian;
{ Show Debug info }
if ppufiletime<>-1 then
Message1(unit_u_ppu_time,filetimestring(ppufiletime))
diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas
index d8e52f01ad..509788b1a3 100644
--- a/compiler/pgenutil.pas
+++ b/compiler/pgenutil.pas
@@ -1059,7 +1059,7 @@ uses
replaydepth:=current_scanner.replay_stack_depth;
if genericdef.typ=procdef then
begin
- current_scanner.startreplaytokens(tprocdef(genericdef).genericdecltokenbuf,tprocdef(genericdef).generic_buf_needs_swapping);
+ current_scanner.startreplaytokens(tprocdef(genericdef).genericdecltokenbuf,hmodule.change_endian);
parse_proc_head(tprocdef(genericdef).struct,tprocdef(genericdef).proctypeoption,false,genericdef,generictypelist,pd);
if assigned(pd) then
begin
@@ -1073,7 +1073,7 @@ uses
end
else
begin
- current_scanner.startreplaytokens(genericdef.generictokenbuf,genericdef.generic_buf_needs_swapping);
+ current_scanner.startreplaytokens(genericdef.generictokenbuf,hmodule.change_endian);
hadtypetoken:=false;
read_named_type(result,srsym,genericdef,generictypelist,false,hadtypetoken);
ttypesym(srsym).typedef:=result;
@@ -1721,7 +1721,7 @@ uses
{ use the index the module got from the current compilation process }
current_filepos.moduleindex:=hmodule.unit_index;
current_tokenpos:=current_filepos;
- current_scanner.startreplaytokens(tprocdef(def.genericdef).generictokenbuf,tprocdef(def.genericdef).generic_buf_needs_swapping);
+ current_scanner.startreplaytokens(tprocdef(def.genericdef).generictokenbuf,hmodule.change_endian);
read_proc_body(def);
current_filepos:=oldcurrent_filepos;
end
diff --git a/compiler/symdef.pas b/compiler/symdef.pas
index e449af7e4c..3cec76f937 100644
--- a/compiler/symdef.pas
+++ b/compiler/symdef.pas
@@ -88,7 +88,6 @@ interface
genericdef : tstoreddef;
genericdefderef : tderef;
generictokenbuf : tdynamicarray;
- generic_buf_needs_swapping : boolean;
{ this list contains references to the symbols that make up the
generic parameters; the symbols are not owned by this list
Note: this list is allocated on demand! }
@@ -1812,7 +1811,6 @@ implementation
fileinfo := current_filepos;
{$endif}
generictokenbuf:=nil;
- generic_buf_needs_swapping:=false;
genericdef:=nil;
typesymderef.reset;
genericdefderef.reset;
@@ -1906,7 +1904,6 @@ implementation
begin
sizeleft:=ppufile.getlongint;
initgeneric;
- generic_buf_needs_swapping:=ppufile.change_endian;
while sizeleft>0 do
begin
if sizeleft>sizeof(buf) then