From cc9f8b7f5685e205695165386f3d262b0c02132f Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 30 Jun 2019 16:24:44 +0000 Subject: [PATCH] * record in ppu flag whether or not symbols are ansistrings, and use that flag in ppudump rather than hardcoding targets (it's also the case for LLVM) git-svn-id: trunk@42312 - --- compiler/fppu.pas | 3 +++ compiler/globtype.pas | 3 ++- compiler/utils/ppuutils/ppudump.pp | 21 +++++++++++++-------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/compiler/fppu.pas b/compiler/fppu.pas index d754018cf8..6085eb45de 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -1021,6 +1021,9 @@ var {$ifdef llvm} include(moduleflags,mf_llvm); {$endif} +{$ifdef symansistr} + include(moduleflags,mf_symansistr); +{$endif} old_docrc:=ppufile.do_crc; ppufile.do_crc:=false; diff --git a/compiler/globtype.pas b/compiler/globtype.pas index 612771925b..d68488dff2 100644 --- a/compiler/globtype.pas +++ b/compiler/globtype.pas @@ -377,7 +377,8 @@ interface mf_i8086_ss_equals_ds, { this unit uses an i8086 memory model with SS=DS (i.e. tiny, small or medium) } mf_package_deny, { this unit must not be part of a package } mf_package_weak, { this unit may be completely contained in a package } - mf_llvm { compiled for LLVM code generator, not compatible with regular compiler because of different nodes in inline functions } + mf_llvm, { compiled for LLVM code generator, not compatible with regular compiler because of different nodes in inline functions } + mf_symansistr { symbols are ansistrings (for ppudump) } ); tmoduleflags = set of tmoduleflag; diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp index 598d3023db..47c6e8683f 100644 --- a/compiler/utils/ppuutils/ppudump.pp +++ b/compiler/utils/ppuutils/ppudump.pp @@ -234,6 +234,7 @@ var UnitList: TPpuContainerDef; CurUnit: TPpuModuleDef; SkipVersionCheck: boolean; + SymAnsiStr: boolean; {**************************************************************************** @@ -661,6 +662,14 @@ end; Read Routines ****************************************************************************} +function readsymstr(ppufile: tppufile): ansistring; + begin + if not(mf_symansistr in CurUnit.ModuleFlags) then + result:=ppufile.getstring + else + result:=ppufile.getansistring; + end; + function readmanagementoperatoroptions(const space : string;const name : string):tmanagementoperators;forward; procedure readrecsymtableoptions; @@ -3147,10 +3156,7 @@ begin write ([space,' DefaultConst : ']); readderef(''); if (vo_has_mangledname in varoptions) then - if tsystemcpu(ppufile.header.common.cpu)=cpu_jvm then - writeln([space,'AMangledname : ',getansistring]) - else - writeln([space,'SMangledname : ',getstring]); + writeln([space,'Mangledname : ',readsymstr(ppufile)]); if vo_has_section in varoptions then writeln(['Section name:',ppufile.getansistring]); write ([space,' FieldVarSymDeref: ']); @@ -3575,10 +3581,7 @@ begin readcommondef('Procedure definition',defoptions,def); read_abstract_proc_def(calloption,procoptions,TPpuProcDef(def)); if (po_has_mangledname in procoptions) then - if tsystemcpu(ppufile.header.common.cpu)=cpu_jvm then - writeln([space,' Mangled name : ',getansistring]) - else - writeln([space,' Mangled name : ',getstring]); + writeln([space,' Mangled name : ',readsymstr(ppufile)]); writeln([space,' Number : ',getword]); writeln([space,' Level : ',getbyte]); write ([space,' Class : ']); @@ -4071,6 +4074,8 @@ begin CurUnit.LongVersion:=cardinal(getlongint); Writeln(['LongVersion: ',CurUnit.LongVersion]); getsmallset(CurUnit.ModuleFlags); + if mf_symansistr in CurUnit.ModuleFlags then + SymAnsiStr:=true; end; ibmodulename :