From 83611b83cc9b24d1db270e1d545536c651f97ffd Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 21 Jul 2019 11:07:02 +0000 Subject: [PATCH] * reverted r42463, the internalerrors were caused by a bug in the LLVM typed constant builder git-svn-id: trunk@42478 - --- compiler/ncgrtti.pas | 13 +++---------- compiler/symconst.pas | 2 ++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas index 11f2f0bceb..d310207c71 100644 --- a/compiler/ncgrtti.pas +++ b/compiler/ncgrtti.pas @@ -1886,23 +1886,16 @@ implementation tbltcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable,tcalo_apply_constalign]); - { can't use reuse a name, because the size depends on the number and kinds of of parameters each attribute has } tbltcb.begin_anonymous_record( - '', + internaltypeprefixName[itp_rtti_attr_list]+tostr(count), defaultpacking,min(reqalign,SizeOf(PInt)), targetinfos[target_info.system]^.alignment.recordalignmin); tbltcb.emit_ord_const(count,u16inttype); for i:=0 to count-1 do begin + tbltcb.begin_anonymous_record(internaltypeprefixName[itp_rtti_attr_entry],defaultpacking,min(reqalign,SizeOf(PInt)), + targetinfos[target_info.system]^.alignment.recordalignmin); attr:=trtti_attribute(attr_list.rtti_attributes[i]); - { only the length of an entry with no parameters is constant, so only reuse a recorddef for - those entries } - if length(attr.paras)=0 then - tbltcb.begin_anonymous_record(internaltypeprefixName[itp_rtti_attr_entry],defaultpacking,min(reqalign,SizeOf(PInt)), - targetinfos[target_info.system]^.alignment.recordalignmin) - else - tbltcb.begin_anonymous_record('',defaultpacking,min(reqalign,SizeOf(PInt)), - targetinfos[target_info.system]^.alignment.recordalignmin); write_rtti_reference(tbltcb,ttypesym(attr.typesym).typedef,fullrtti); diff --git a/compiler/symconst.pas b/compiler/symconst.pas index f85bd692b4..2e8aa194d6 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -732,6 +732,7 @@ type itp_rtti_common_data, itp_rtti_prop, itp_rtti_ansistr, + itp_rtti_attr_list, itp_rtti_attr_entry, itp_rtti_ord_outer, itp_rtti_ord_middle, @@ -884,6 +885,7 @@ inherited_objectoptions : tobjectoptions = [oo_has_virtual,oo_has_private,oo_has '$rtti_common_data$', '$rtti_prop$', '$rtti_ansistr$', + '$rtti_attr_list$', '$rtti_attr_entry$', '$rtti_ord_outer$', '$rtti_ord_middle$',