mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 04:59:26 +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 }
|
||||
case left.nodetype of
|
||||
stringconstn :
|
||||
if (convtype=tc_string_2_string) and
|
||||
(resultdef.typ=stringdef) and
|
||||
(
|
||||
((not is_widechararray(left.resultdef) and
|
||||
not is_wide_or_unicode_string(left.resultdef)) or
|
||||
(tstringdef(resultdef).stringtype in [st_widestring,st_unicodestring,st_ansistring])
|
||||
if (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
|
||||
(tstringdef(resultdef).stringtype in [st_widestring,st_unicodestring,st_ansistring])
|
||||
)
|
||||
)
|
||||
)
|
||||
) then
|
||||
) then
|
||||
begin
|
||||
{ output string consts in local ansistring encoding }
|
||||
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