summaryrefslogtreecommitdiff
path: root/compiler/symdef.pas
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/symdef.pas')
-rw-r--r--compiler/symdef.pas74
1 files changed, 41 insertions, 33 deletions
diff --git a/compiler/symdef.pas b/compiler/symdef.pas
index 69e33001a7..cb46531ff5 100644
--- a/compiler/symdef.pas
+++ b/compiler/symdef.pas
@@ -26,7 +26,7 @@ interface
uses
{ common }
- cclasses,
+ cclasses,widestr,
{ global }
globtype,globals,tokens,constexp,
{ symtable }
@@ -2219,7 +2219,6 @@ implementation
var
recsize,temp: longint;
begin
- is_intregable:=false;
case typ of
orddef,
pointerdef,
@@ -2250,6 +2249,8 @@ implementation
not needs_inittable;
{$endif llvm}
end;
+ else
+ is_intregable:=false;
end;
end;
@@ -2580,8 +2581,6 @@ implementation
alignment:=size_2_align(2)
else
alignment:=size_2_align(1);
- else
- internalerror(200412301);
end;
end;
@@ -2608,8 +2607,6 @@ implementation
st_widestring,
st_unicodestring:
Result:=voidpointertype.size;
- else
- internalerror(2014032301);
end;
end;
@@ -3179,8 +3176,6 @@ implementation
result:=cfiledef.createuntyped;
ft_text:
result:=cfiledef.createtext;
- else
- internalerror(2004121201);
end;
end;
@@ -3223,8 +3218,6 @@ implementation
end;
ft_untyped:
savesize:=search_system_type('FILEREC').typedef.size;
- else
- internalerror(2013113001);
end;
end;
@@ -3237,8 +3230,6 @@ implementation
ft_typed,
ft_untyped:
result:=search_system_type('FILEREC').typedef.alignment;
- else
- internalerror(2018120101);
end;
end;
@@ -3262,8 +3253,6 @@ implementation
GetTypeName:='File Of '+typedfiledef.typename;
ft_text:
GetTypeName:='Text'
- else
- internalerror(2013113002);
end;
end;
@@ -3277,8 +3266,6 @@ implementation
getmangledparaname:='FILE$OF$'+typedfiledef.mangledparaname;
ft_text:
getmangledparaname:='TEXT'
- else
- internalerror(2013113003);
end;
end;
@@ -3341,8 +3328,6 @@ implementation
GetTypeName:='Variant';
vt_olevariant:
GetTypeName:='OleVariant';
- else
- internalerror(2013113004);
end;
end;
@@ -5054,7 +5039,7 @@ implementation
hp : TParavarsym;
hpc : tconstsym;
first : boolean;
- i : integer;
+ i,j : integer;
begin
s:='';
first:=true;
@@ -5082,6 +5067,8 @@ implementation
s:=s+'out ';
vs_constref :
s:=s+'constref ';
+ else
+ ;
end;
if (pno_paranames in pno) then
s:=s+hp.realname+':';
@@ -5103,23 +5090,38 @@ implementation
hpc:=tconstsym(hp.defaultconstsym);
hs:='';
case hpc.consttyp of
+ constwstring:
+ begin
+ if pcompilerwidestring(hpc.value.valueptr)^.len>0 then
+ begin
+ setlength(hs,pcompilerwidestring(hpc.value.valueptr)^.len);
+ for j:=0 to pcompilerwidestring(hpc.value.valueptr)^.len-1 do
+ begin
+ if (ord(pcompilerwidestring(hpc.value.valueptr)^.data[j])<127) and
+ not(byte(pcompilerwidestring(hpc.value.valueptr)^.data[j]) in [0,10,13]) then
+ hs[j+1]:=char(pcompilerwidestring(hpc.value.valueptr)^.data[j])
+ else
+ hs[j+1]:='.';
+ end;
+ end;
+ end;
conststring,
constresourcestring :
begin
- If hpc.value.len>0 then
- begin
- setLength(hs,hpc.value.len);
- { don't write past the end of hs if the constant
- is > 255 chars }
- move(hpc.value.valueptr^,hs[1],length(hs));
- { make sure that constant strings with newline chars
- don't create a linebreak in the assembler code,
- since comments are line-based. Also remove nulls
- because the comments are written as a pchar. }
- ReplaceCase(hs,#0,'.');
- ReplaceCase(hs,#10,'.');
- ReplaceCase(hs,#13,'.');
- end;
+ if hpc.value.len>0 then
+ begin
+ setLength(hs,hpc.value.len);
+ { don't write past the end of hs if the constant
+ is > 255 chars }
+ move(hpc.value.valueptr^,hs[1],length(hs));
+ { make sure that constant strings with newline chars
+ don't create a linebreak in the assembler code,
+ since comments are line-based. Also remove nulls
+ because the comments are written as a pchar. }
+ ReplaceCase(hs,#0,'.');
+ ReplaceCase(hs,#10,'.');
+ ReplaceCase(hs,#13,'.');
+ end;
end;
constreal :
str(pbestreal(hpc.value.valueptr)^,hs);
@@ -5141,6 +5143,10 @@ implementation
hs:='nil';
constset :
hs:='<set>';
+ constguid:
+ hs:=guid2string(pguid(hpc.value.valueptr)^);
+ constnone:
+ internalerror(2019050704);
end;
if hs<>'' then
s:=s+'=`'+hs+'`';
@@ -7508,6 +7514,8 @@ implementation
end;
odt_objcprotocol:
result:=result+'_OBJC_PROTOCOL_';
+ else
+ ;
end;
end
else