mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 19:09:23 +02:00
* handle tc_equal typeconversions from conststring to a stringdef in
simplify, so that shortstring -> shortstring constant string conversions are simplified for LLVM too (it leaves regular tc_equal type conversions because often the type is still somewhat different), which is required for the code in tasmlisttypedconstbuilder.tc_emit_stringdef() (it assumes the result of inserting a type conversion is again a stringconstant if it can be handled at compile time) git-svn-id: trunk@32907 -
This commit is contained in:
parent
0350369c6a
commit
bbe8e346e0
@ -2654,14 +2654,17 @@ implementation
|
|||||||
remove the typeconv node }
|
remove the typeconv node }
|
||||||
case left.nodetype of
|
case left.nodetype of
|
||||||
stringconstn :
|
stringconstn :
|
||||||
if (convtype=tc_string_2_string) and
|
if (resultdef.typ=stringdef) and
|
||||||
(resultdef.typ=stringdef) and
|
((convtype=tc_equal) or
|
||||||
(
|
((convtype=tc_string_2_string) and
|
||||||
((not is_widechararray(left.resultdef) and
|
(
|
||||||
not is_wide_or_unicode_string(left.resultdef)) or
|
((not is_widechararray(left.resultdef) and
|
||||||
(tstringdef(resultdef).stringtype in [st_widestring,st_unicodestring,st_ansistring])
|
not is_wide_or_unicode_string(left.resultdef)) or
|
||||||
|
(tstringdef(resultdef).stringtype in [st_widestring,st_unicodestring,st_ansistring])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
) then
|
) then
|
||||||
begin
|
begin
|
||||||
{ output string consts in local ansistring encoding }
|
{ output string consts in local ansistring encoding }
|
||||||
if is_ansistring(resultdef) and ((tstringdef(resultdef).encoding=0)or(tstringdef(resultdef).encoding=globals.CP_NONE)) then
|
if is_ansistring(resultdef) and ((tstringdef(resultdef).encoding=0)or(tstringdef(resultdef).encoding=globals.CP_NONE)) then
|
||||||
|
Loading…
Reference in New Issue
Block a user