mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 00:07:28 +01:00
Rename tsymtable.insert and delete methods to insertsym ands deletesym
This commit is contained in:
parent
8851c8968c
commit
5acd7a7b83
@ -175,7 +175,7 @@ implementation
|
||||
descriptordef:=search_named_unit_globaltype('BLOCKRTL','FPC_BLOCK_DESCRIPTOR_SIMPLE',true).typedef;
|
||||
{ create new static variable }
|
||||
descriptor:=cstaticvarsym.create(name,vs_value,descriptordef,[]);
|
||||
symtablestack.top.insert(descriptor);
|
||||
symtablestack.top.insertsym(descriptor);
|
||||
include(descriptor.symoptions,sp_internal);
|
||||
{ create typed constant for the descriptor }
|
||||
str_parse_typedconst(current_asmdata.AsmLists[al_const],
|
||||
@ -227,7 +227,7 @@ implementation
|
||||
begin
|
||||
{ alias for the type to invoke the procvar, used in the symcreat
|
||||
handling of tsk_block_invoke_procvar }
|
||||
result.localst.insert(ctypesym.create('__FPC_BLOCK_INVOKE_PV_TYPE',orgpv));
|
||||
result.localst.insertsym(ctypesym.create('__FPC_BLOCK_INVOKE_PV_TYPE',orgpv));
|
||||
result.synthetickind:=tsk_block_invoke_procvar;
|
||||
end;
|
||||
end;
|
||||
@ -255,7 +255,7 @@ implementation
|
||||
vs_value,
|
||||
blockliteraldef,[]);
|
||||
include(result.symoptions,sp_internal);
|
||||
symtablestack.top.insert(result);
|
||||
symtablestack.top.insertsym(result);
|
||||
{ initialise it }
|
||||
str_parse_typedconst(current_asmdata.AsmLists[al_const],
|
||||
'(base: (isa : @'+blockisasym.realname+
|
||||
|
||||
@ -1100,7 +1100,7 @@ implementation
|
||||
if not assigned(sym) then
|
||||
begin
|
||||
ps:=cprocsym.create('Create');
|
||||
obj.symtable.insert(ps);
|
||||
obj.symtable.insertsym(ps);
|
||||
end;
|
||||
{ determine symtable level }
|
||||
topowner:=obj;
|
||||
|
||||
@ -452,7 +452,7 @@ implementation
|
||||
csym:=cconstsym.create_ptr('_$setconst'+tostr(current_module.symlist.count),constset,ps,resultdef);
|
||||
csym.visibility:=vis_private;
|
||||
include(csym.symoptions,sp_internal);
|
||||
current_module.localsymtable.insert(csym);
|
||||
current_module.localsymtable.insertsym(csym);
|
||||
{ generate assignment of the constant to the typed constant symbol }
|
||||
ssym:=jvm_add_typed_const_initializer(csym);
|
||||
result:=current_asmdata.RefAsmSymbol(ssym.mangledname,AT_DATA);
|
||||
|
||||
@ -214,7 +214,7 @@ implementation
|
||||
vs:=cstaticvarsym.create(sym.realname+'$threadvar',sym.varspez,
|
||||
jvmgetthreadvardef(sym.vardef),
|
||||
sym.varoptions - [vo_is_thread_var]);
|
||||
sym.owner.insert(vs);
|
||||
sym.owner.insertsym(vs);
|
||||
{ make sure that the new sym does not get allocated (we will allocate
|
||||
it when encountering the original sym, because only then we know
|
||||
that it's a threadvar) }
|
||||
@ -496,7 +496,7 @@ implementation
|
||||
begin
|
||||
{ add the args parameter }
|
||||
pvs:=cparavarsym.create('$args',1,vs_const,search_system_type('TJSTRINGARRAY').typedef,[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
tprocdef(pd).calcparas;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -175,7 +175,7 @@ implementation
|
||||
name that can be used in generated Pascal code without risking an
|
||||
identifier conflict (since it is local to this class; the global name
|
||||
is unique because it's an identifier that contains $-signs) }
|
||||
enumclass.symtable.insert(ctypesym.create('__FPC_TEnumClassAlias',enumclass));
|
||||
enumclass.symtable.insertsym(ctypesym.create('__FPC_TEnumClassAlias',enumclass));
|
||||
|
||||
{ also create an alias for the enum type so that we can iterate over
|
||||
all enum values when creating the body of the class constructor }
|
||||
@ -183,7 +183,7 @@ implementation
|
||||
{ don't pass def to the ttypesym constructor, because then it
|
||||
will replace the current (real) typesym of that def with the alias }
|
||||
temptypesym.typedef:=def;
|
||||
enumclass.symtable.insert(temptypesym);
|
||||
enumclass.symtable.insertsym(temptypesym);
|
||||
{ but the name of the class as far as the JVM is concerned will match
|
||||
the enum's original name (the enum type itself won't be output in
|
||||
any class file, so no conflict there)
|
||||
@ -212,14 +212,14 @@ implementation
|
||||
for i:=0 to tenumdef(def).symtable.symlist.count-1 do
|
||||
begin
|
||||
fsym:=cfieldvarsym.create(tenumsym(tenumdef(def).symtable.symlist[i]).realname,vs_final,enumclass,[]);
|
||||
enumclass.symtable.insert(fsym);
|
||||
enumclass.symtable.insertsym(fsym);
|
||||
sym:=make_field_static(enumclass.symtable,fsym);
|
||||
{ add alias for the field representing ordinal(0), for use in
|
||||
initialization code }
|
||||
if tenumsym(tenumdef(def).symtable.symlist[i]).value=0 then
|
||||
begin
|
||||
aliassym:=cstaticvarsym.create('__FPC_Zero_Initializer',vs_final,enumclass,[vo_is_external]);
|
||||
enumclass.symtable.insert(aliassym);
|
||||
enumclass.symtable.insertsym(aliassym);
|
||||
aliassym.set_raw_mangledname(sym.mangledname);
|
||||
end;
|
||||
end;
|
||||
@ -228,7 +228,7 @@ implementation
|
||||
arrdef:=carraydef.create(0,tenumdef(def).symtable.symlist.count-1,s32inttype);
|
||||
arrdef.elementdef:=enumclass;
|
||||
arrsym:=ctypesym.create('__FPC_TEnumValues',arrdef);
|
||||
enumclass.symtable.insert(arrsym);
|
||||
enumclass.symtable.insertsym(arrsym);
|
||||
{ insert "public static values: array of enumclass" that returns $VALUES.clone()
|
||||
(rather than a dynamic array and using clone --which we don't support yet for arrays--
|
||||
simply use a fixed length array and copy it) }
|
||||
@ -242,12 +242,12 @@ implementation
|
||||
begin
|
||||
{ add field for the value }
|
||||
fsym:=cfieldvarsym.create('__fpc_fenumval',vs_final,s32inttype,[]);
|
||||
enumclass.symtable.insert(fsym);
|
||||
enumclass.symtable.insertsym(fsym);
|
||||
tobjectsymtable(enumclass.symtable).addfield(fsym,vis_strictprivate);
|
||||
{ add class field with hash table that maps from FPC-declared ordinal value -> enum instance }
|
||||
juhashmap:=search_system_type('JUHASHMAP').typedef;
|
||||
fsym:=cfieldvarsym.create('__fpc_ord2enum',vs_final,juhashmap,[]);
|
||||
enumclass.symtable.insert(fsym);
|
||||
enumclass.symtable.insertsym(fsym);
|
||||
make_field_static(enumclass.symtable,fsym);
|
||||
{ add custom constructor }
|
||||
if not str_parse_method_dec('constructor Create(const __fpc_name: JLString; const __fpc_ord, __fpc_initenumval: longint);',potype_constructor,false,enumclass,pd) then
|
||||
@ -305,12 +305,12 @@ implementation
|
||||
checking when creating the "Values" method }
|
||||
fsym:=cfieldvarsym.create('$VALUES',vs_final,arrdef,[]);
|
||||
fsym.visibility:=vis_strictprivate;
|
||||
enumclass.symtable.insert(fsym,false);
|
||||
enumclass.symtable.insertsym(fsym,false);
|
||||
sym:=make_field_static(enumclass.symtable,fsym);
|
||||
{ alias for accessing the field in generated Pascal code }
|
||||
sl:=tpropaccesslist.create;
|
||||
sl.addsym(sl_load,sym);
|
||||
enumclass.symtable.insert(cabsolutevarsym.create_ref('__fpc_FVALUES',arrdef,sl));
|
||||
enumclass.symtable.insertsym(cabsolutevarsym.create_ref('__fpc_FVALUES',arrdef,sl));
|
||||
{ add initialization of the static class fields created above }
|
||||
if not str_parse_method_dec('constructor fpc_enum_class_constructor;',potype_class_constructor,true,enumclass,pd) then
|
||||
internalerror(2011062303);
|
||||
@ -356,7 +356,7 @@ implementation
|
||||
if df_generic in def.defoptions then
|
||||
include(pvclass.defoptions,df_generic);
|
||||
{ associate typesym }
|
||||
pvclass.symtable.insert(ctypesym.create('__FPC_TProcVarClassAlias',pvclass));
|
||||
pvclass.symtable.insertsym(ctypesym.create('__FPC_TProcVarClassAlias',pvclass));
|
||||
{ set external name to match procvar type name }
|
||||
if not islocal then
|
||||
pvclass.objextname:=stringdup(name)
|
||||
@ -381,7 +381,7 @@ implementation
|
||||
{ don't pass def to the ttypesym constructor, because then it
|
||||
will replace the current (real) typesym of that def with the alias }
|
||||
temptypesym.typedef:=def;
|
||||
pvclass.symtable.insert(temptypesym);
|
||||
pvclass.symtable.insertsym(temptypesym);
|
||||
|
||||
{ in case of a procedure of object, add a nested interface type that
|
||||
has one method that conforms to the procvartype (with name
|
||||
@ -398,7 +398,7 @@ implementation
|
||||
if df_generic in def.defoptions then
|
||||
include(pvintf.defoptions,df_generic);
|
||||
{ associate typesym }
|
||||
pvclass.symtable.insert(ctypesym.create('Callback',pvintf));
|
||||
pvclass.symtable.insertsym(ctypesym.create('Callback',pvintf));
|
||||
|
||||
{ add a method prototype matching the procvar (like the invoke
|
||||
in the procvarclass itself) }
|
||||
@ -507,7 +507,7 @@ implementation
|
||||
Pascal code }
|
||||
typ:=ctypesym.create('__fpc_virtualclassmethod_pv_t'+wrapperpd.unique_id_str,wrapperpv);
|
||||
wrapperpv.classdef.typesym.visibility:=vis_strictprivate;
|
||||
symtablestack.top.insert(typ);
|
||||
symtablestack.top.insertsym(typ);
|
||||
symtablestack.pop(pd.owner);
|
||||
end;
|
||||
|
||||
@ -595,7 +595,7 @@ implementation
|
||||
{ make sure we don't emit a definition for this field (we'll do
|
||||
that for the constsym already) -> mark as external }
|
||||
ssym:=cstaticvarsym.create(internal_static_field_name(csym.realname),vs_final,csym.constdef,[vo_is_external]);
|
||||
csym.owner.insert(ssym);
|
||||
csym.owner.insertsym(ssym);
|
||||
{ alias storage to the constsym }
|
||||
ssym.set_mangledname(csym.realname);
|
||||
for i:=0 to tenumdef(csym.constdef).symtable.symlist.count-1 do
|
||||
@ -633,7 +633,7 @@ implementation
|
||||
}
|
||||
symtablestack.push(current_module.localsymtable);
|
||||
ssym:=cstaticvarsym.create(internal_static_field_name(csym.realname),vs_final,tsetdef(csym.constdef).getcopy,[vo_is_external,vo_has_local_copy]);
|
||||
symtablestack.top.insert(ssym);
|
||||
symtablestack.top.insertsym(ssym);
|
||||
symtablestack.pop(current_module.localsymtable);
|
||||
{ alias storage to the constsym }
|
||||
ssym.set_mangledname(csym.realname);
|
||||
|
||||
@ -416,7 +416,7 @@ implementation
|
||||
(sym.owner<>owner) then
|
||||
begin
|
||||
ps:=cprocsym.create(accessorname);
|
||||
obj.symtable.insert(ps);
|
||||
obj.symtable.insertsym(ps);
|
||||
end
|
||||
else
|
||||
ps:=tprocsym(sym);
|
||||
@ -444,7 +444,7 @@ implementation
|
||||
begin
|
||||
{ parameter with value to set }
|
||||
pvs:=cparavarsym.create('__fpc_newval__',10,vs_const,propdef,[]);
|
||||
pd.parast.insert(pvs);
|
||||
pd.parast.insertsym(pvs);
|
||||
end;
|
||||
if (ppo_hasparameters in propoptions) and
|
||||
not assigned(orgaccesspd) then
|
||||
@ -477,7 +477,7 @@ implementation
|
||||
tmpaccesslist:=callthroughprop.propaccesslist[accesstyp];
|
||||
callthroughprop.propaccesslist[accesstyp]:=propaccesslist[accesstyp];
|
||||
propaccesslist[accesstyp]:=tmpaccesslist;
|
||||
owner.insert(callthroughprop);
|
||||
owner.insertsym(callthroughprop);
|
||||
|
||||
pd.skpara:=callthroughprop;
|
||||
{ needs to be exported }
|
||||
|
||||
@ -588,7 +588,7 @@ implementation
|
||||
internaltypeprefixName[itp_vardisp_calldesc]+current_module.modulename^+'$'+tostr(current_module.localsymtable.SymList.count),
|
||||
vs_const,tcb.end_anonymous_record,[vo_is_public,vo_is_typed_const]);
|
||||
calldescsym.varstate:=vs_initialised;
|
||||
current_module.localsymtable.insert(calldescsym);
|
||||
current_module.localsymtable.insertsym(calldescsym);
|
||||
current_asmdata.AsmLists[al_typedconsts].concatList(
|
||||
tcb.get_final_asmlist(
|
||||
current_asmdata.DefineAsmSymbol(calldescsym.mangledname,AB_GLOBAL,AT_DATA,calldescsym.vardef),
|
||||
|
||||
@ -1666,11 +1666,11 @@ implementation
|
||||
(target_info.system in (systems_darwin+[system_powerpc_macosclassic]+systems_aix)) then
|
||||
begin
|
||||
pvs:=cparavarsym.create('ARGC',1,vs_const,s32inttype,[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
pvs:=cparavarsym.create('ARGV',2,vs_const,cpointerdef.getreusable(charpointertype),[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
pvs:=cparavarsym.create('ARGP',3,vs_const,cpointerdef.getreusable(charpointertype),[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
tprocdef(pd).calcparas;
|
||||
end
|
||||
{ package stub for Windows is a DLLMain }
|
||||
@ -1678,11 +1678,11 @@ implementation
|
||||
(target_info.system in systems_all_windows+systems_nativent) then
|
||||
begin
|
||||
pvs:=cparavarsym.create('HINSTANCE',1,vs_const,uinttype,[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
pvs:=cparavarsym.create('DLLREASON',2,vs_const,u32inttype,[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
pvs:=cparavarsym.create('DLLPARAM',3,vs_const,voidpointertype,[]);
|
||||
tprocdef(pd).parast.insert(pvs);
|
||||
tprocdef(pd).parast.insertsym(pvs);
|
||||
tprocdef(pd).returndef:=bool32type;
|
||||
insert_funcret_para(tprocdef(pd));
|
||||
tprocdef(pd).calcparas;
|
||||
|
||||
@ -468,7 +468,7 @@ implementation
|
||||
begin
|
||||
{ no valid default variable found, so create it }
|
||||
srsym:=clocalvarsym.create(defaultname,vs_const,def,[]);
|
||||
srsymtable.insert(srsym);
|
||||
srsymtable.insertsym(srsym);
|
||||
{ mark the staticvarsym as typedconst }
|
||||
include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);
|
||||
include(tabstractvarsym(srsym).varoptions,vo_is_default_var);
|
||||
|
||||
@ -256,7 +256,7 @@ implementation
|
||||
sym.symoptions:=sym.symoptions+dummysymoptions;
|
||||
sym.deprecatedmsg:=deprecatedmsg;
|
||||
sym.visibility:=symtablestack.top.currentvisibility;
|
||||
symtablestack.top.insert(sym);
|
||||
symtablestack.top.insertsym(sym);
|
||||
sym.register_sym;
|
||||
{$ifdef jvm}
|
||||
{ for the JVM target, some constants need to be
|
||||
@ -305,14 +305,14 @@ implementation
|
||||
constant data correctly for error recovery }
|
||||
check_allowed_for_var_or_const(hdef,false);
|
||||
sym:=cfieldvarsym.create(orgname,varspez,hdef,[]);
|
||||
symtablestack.top.insert(sym);
|
||||
symtablestack.top.insertsym(sym);
|
||||
sym:=make_field_static(symtablestack.top,tfieldvarsym(sym));
|
||||
end
|
||||
else
|
||||
begin
|
||||
sym:=cstaticvarsym.create(orgname,varspez,hdef,[]);
|
||||
sym.visibility:=symtablestack.top.currentvisibility;
|
||||
symtablestack.top.insert(sym);
|
||||
symtablestack.top.insertsym(sym);
|
||||
end;
|
||||
sym.register_sym;
|
||||
current_tokenpos:=storetokenpos;
|
||||
@ -396,18 +396,18 @@ implementation
|
||||
labelsym:=clabelsym.create(pattern);
|
||||
end;
|
||||
|
||||
symtablestack.top.insert(labelsym);
|
||||
symtablestack.top.insertsym(labelsym);
|
||||
if m_non_local_goto in current_settings.modeswitches then
|
||||
begin
|
||||
if symtablestack.top.symtabletype=localsymtable then
|
||||
begin
|
||||
labelsym.jumpbuf:=clocalvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
|
||||
symtablestack.top.insert(labelsym.jumpbuf);
|
||||
symtablestack.top.insertsym(labelsym.jumpbuf);
|
||||
end
|
||||
else
|
||||
begin
|
||||
labelsym.jumpbuf:=cstaticvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
|
||||
symtablestack.top.insert(labelsym.jumpbuf);
|
||||
symtablestack.top.insertsym(labelsym.jumpbuf);
|
||||
cnodeutils.insertbssdata(tstaticvarsym(labelsym.jumpbuf));
|
||||
end;
|
||||
include(labelsym.jumpbuf.symoptions,sp_internal);
|
||||
@ -836,7 +836,7 @@ implementation
|
||||
Include(sym.symoptions,sp_generic_dummy);
|
||||
ttypesym(sym).typedef.typesym:=sym;
|
||||
sym.visibility:=symtablestack.top.currentvisibility;
|
||||
symtablestack.top.insert(sym);
|
||||
symtablestack.top.insertsym(sym);
|
||||
ttypesym(sym).typedef.owner:=sym.owner;
|
||||
end
|
||||
else
|
||||
@ -875,7 +875,7 @@ implementation
|
||||
begin
|
||||
newtype:=ctypesym.create(genorgtypename,hdef);
|
||||
newtype.visibility:=symtablestack.top.currentvisibility;
|
||||
symtablestack.top.insert(newtype);
|
||||
symtablestack.top.insertsym(newtype);
|
||||
end;
|
||||
current_tokenpos:=defpos;
|
||||
current_tokenpos:=storetokenpos;
|
||||
@ -1315,7 +1315,7 @@ implementation
|
||||
begin
|
||||
sym.symoptions:=sym.symoptions+dummysymoptions;
|
||||
sym.deprecatedmsg:=deprecatedmsg;
|
||||
symtablestack.top.insert(sym);
|
||||
symtablestack.top.insertsym(sym);
|
||||
end
|
||||
else
|
||||
stringdispose(deprecatedmsg);
|
||||
|
||||
@ -247,7 +247,7 @@ implementation
|
||||
if assigned(defaultvalue) then
|
||||
begin
|
||||
include(defaultvalue.symoptions,sp_internal);
|
||||
pd.parast.insert(defaultvalue);
|
||||
pd.parast.insertsym(defaultvalue);
|
||||
{ check whether the default value is of the correct
|
||||
type }
|
||||
if compare_defs_ext(defaultvalue.constdef,hdef,nodetype,doconv,convpd,[])<=te_convert_operator then
|
||||
@ -324,7 +324,7 @@ implementation
|
||||
repeat
|
||||
inc(paranr);
|
||||
vs:=cparavarsym.create(orgpattern,paranr*10,varspez,generrordef,[]);
|
||||
currparast.insert(vs);
|
||||
currparast.insertsym(vs);
|
||||
if assigned(vs.owner) then
|
||||
sc.add(vs)
|
||||
else
|
||||
@ -1112,7 +1112,7 @@ implementation
|
||||
aprocsym:=cprocsym.create(orgsp);
|
||||
if addgendummy then
|
||||
include(aprocsym.symoptions,sp_generic_dummy);
|
||||
symtablestack.top.insert(aprocsym);
|
||||
symtablestack.top.insertsym(aprocsym);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1175,9 +1175,9 @@ implementation
|
||||
allowed, so we create a procsym as dummy }
|
||||
dummysym:=cprocsym.create(orgspnongen);
|
||||
if assigned(astruct) then
|
||||
astruct.symtable.insert(dummysym)
|
||||
astruct.symtable.insertsym(dummysym)
|
||||
else
|
||||
symtablestack.top.insert(dummysym);
|
||||
symtablestack.top.insertsym(dummysym);
|
||||
end
|
||||
else if (dummysym.typ<>procsym) and
|
||||
(
|
||||
@ -2277,7 +2277,7 @@ begin
|
||||
if vo_has_explicit_paraloc in vo then
|
||||
if not paramanager.parseparaloc(vs,po_syscall_to_regname) then
|
||||
internalerror(2016120301);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
end
|
||||
else
|
||||
Message(parser_e_32bitint_or_pointer_variable_expected);
|
||||
|
||||
@ -265,7 +265,7 @@ implementation
|
||||
else
|
||||
handle_calling_convention(pd,hcc_default_actions_intf_struct);
|
||||
sym:=cprocsym.create(prefix+lower(p.realname));
|
||||
symtablestack.top.insert(sym);
|
||||
symtablestack.top.insertsym(sym);
|
||||
pd.procsym:=sym;
|
||||
include(pd.procoptions,po_dispid);
|
||||
include(pd.procoptions,po_global);
|
||||
@ -326,7 +326,7 @@ implementation
|
||||
{ add an extra parameter, a placeholder of the value to set }
|
||||
inc(paranr);
|
||||
hparavs:=cparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
|
||||
writepd.parast.insert(hparavs);
|
||||
writepd.parast.insertsym(hparavs);
|
||||
|
||||
writepd.proctypeoption:=potype_propsetter;
|
||||
writepd.dispid:=hdispid;
|
||||
@ -384,7 +384,7 @@ implementation
|
||||
p.default:=longint($80000000);
|
||||
if is_classproperty then
|
||||
include(p.symoptions, sp_static);
|
||||
symtablestack.top.insert(p);
|
||||
symtablestack.top.insertsym(p);
|
||||
consume(_ID);
|
||||
{ property parameters ? }
|
||||
if try_to_consume(_LECKKLAMMER) then
|
||||
@ -411,7 +411,7 @@ implementation
|
||||
repeat
|
||||
inc(paranr);
|
||||
hreadparavs:=cparavarsym.create(orgpattern,10*paranr,varspez,generrordef,[]);
|
||||
p.parast.insert(hreadparavs);
|
||||
p.parast.insertsym(hreadparavs);
|
||||
sc.add(hreadparavs);
|
||||
consume(_ID);
|
||||
until not try_to_consume(_COMMA);
|
||||
@ -566,7 +566,7 @@ implementation
|
||||
writeprocdef.returndef:=voidtype;
|
||||
inc(paranr);
|
||||
hparavs:=cparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
|
||||
writeprocdef.parast.insert(hparavs);
|
||||
writeprocdef.parast.insertsym(hparavs);
|
||||
{ Insert hidden parameters }
|
||||
if not assigned(astruct) then
|
||||
handle_calling_convention(writeprocdef,hcc_default_actions_intf)
|
||||
@ -655,7 +655,7 @@ implementation
|
||||
if ppo_indexed in p.propoptions then
|
||||
begin
|
||||
hparavs:=cparavarsym.create('$index',10,vs_value,p.indexdef,[]);
|
||||
storedprocdef.parast.insert(hparavs);
|
||||
storedprocdef.parast.insertsym(hparavs);
|
||||
end;
|
||||
|
||||
{ Insert hidden parameters }
|
||||
@ -1135,7 +1135,7 @@ implementation
|
||||
begin
|
||||
tcsym:=cstaticvarsym.create('$default'+vs.realname,vs_const,vs.vardef,[]);
|
||||
include(tcsym.symoptions,sp_internal);
|
||||
symtablestack.top.insert(tcsym);
|
||||
symtablestack.top.insertsym(tcsym);
|
||||
templist:=tasmlist.create;
|
||||
read_typed_const(templist,tcsym,false);
|
||||
{ in case of a generic routine, this initialisation value is not
|
||||
@ -1337,8 +1337,8 @@ implementation
|
||||
if assigned(abssym) then
|
||||
begin
|
||||
st:=vs.owner;
|
||||
vs.owner.Delete(vs);
|
||||
st.insert(abssym);
|
||||
vs.owner.Deletesym(vs);
|
||||
st.insertsym(abssym);
|
||||
sc[0]:=abssym;
|
||||
end;
|
||||
end;
|
||||
@ -1424,11 +1424,11 @@ implementation
|
||||
{ ensure correct error position }
|
||||
old_current_filepos:=current_filepos;
|
||||
current_filepos:=tmp_filepos;
|
||||
symtablestack.top.insert(vs);
|
||||
symtablestack.top.insertsym(vs);
|
||||
current_filepos:=old_current_filepos;
|
||||
end
|
||||
else
|
||||
symtablestack.top.insert(vs);
|
||||
symtablestack.top.insertsym(vs);
|
||||
end;
|
||||
until not try_to_consume(_COMMA);
|
||||
|
||||
@ -1705,7 +1705,7 @@ implementation
|
||||
begin
|
||||
vs.register_sym;
|
||||
sc.add(vs);
|
||||
recst.insert(vs);
|
||||
recst.insertsym(vs);
|
||||
had_generic:=false;
|
||||
end
|
||||
else
|
||||
@ -1910,7 +1910,7 @@ implementation
|
||||
consume(_COLON);
|
||||
fieldvs:=cfieldvarsym.create(sorg,vs_value,generrordef,[]);
|
||||
variantdesc^^.variantselector:=fieldvs;
|
||||
symtablestack.top.insert(fieldvs);
|
||||
symtablestack.top.insertsym(fieldvs);
|
||||
end;
|
||||
read_anon_type(casetype,true);
|
||||
block_type:=bt_var;
|
||||
|
||||
@ -346,8 +346,8 @@ implementation
|
||||
exit_procinfo.nestedexitlabel.used:=true;
|
||||
|
||||
exit_procinfo.nestedexitlabel.jumpbuf:=clocalvarsym.create('LABEL$_'+exit_procinfo.nestedexitlabel.name,vs_value,rec_jmp_buf,[]);
|
||||
exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel);
|
||||
exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel.jumpbuf);
|
||||
exit_procinfo.procdef.localst.insertsym(exit_procinfo.nestedexitlabel);
|
||||
exit_procinfo.procdef.localst.insertsym(exit_procinfo.nestedexitlabel.jumpbuf);
|
||||
end;
|
||||
|
||||
statement_syssym:=cgotonode.create(exit_procinfo.nestedexitlabel);
|
||||
|
||||
@ -1880,7 +1880,7 @@ uses
|
||||
{ insert the symbol only if we don't know already that we have
|
||||
a procsym to add it to and we aren't dealing with a forwarddef }
|
||||
if not assigned(psym) and not assigned(context.forwarddef) then
|
||||
specializest.insert(srsym);
|
||||
specializest.insertsym(srsym);
|
||||
|
||||
{ specializations are declarations as such it is the wisest to
|
||||
declare set the blocktype to "type"; otherwise we'll
|
||||
@ -2472,7 +2472,7 @@ uses
|
||||
internalerror(2019021602);
|
||||
{ type parameters need to be added as strict private }
|
||||
sym.visibility:=vis_strictprivate;
|
||||
st.insert(sym);
|
||||
st.insertsym(sym);
|
||||
include(sym.symoptions,sp_generic_para);
|
||||
end
|
||||
else
|
||||
@ -2489,7 +2489,7 @@ uses
|
||||
generictypedef.changeowner(st);
|
||||
end;
|
||||
end;
|
||||
st.insert(generictype);
|
||||
st.insertsym(generictype);
|
||||
include(generictype.symoptions,sp_generic_para);
|
||||
end;
|
||||
def.genericparas.add(genericlist.nameofindex(i),generictype);
|
||||
@ -2526,7 +2526,7 @@ uses
|
||||
{ the symbol should be only visible to the generic class
|
||||
itself }
|
||||
gensym.visibility:=vis_strictprivate;
|
||||
symtablestack.top.insert(gensym);
|
||||
symtablestack.top.insertsym(gensym);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -664,7 +664,7 @@ implementation
|
||||
sym:=tsym(current_module.localsymtable.symlist[i]);
|
||||
{ this also frees sym, as the symbols are owned by the symtable }
|
||||
if not sym.is_registered then
|
||||
current_module.localsymtable.Delete(sym);
|
||||
current_module.localsymtable.DeleteSym(sym);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -693,7 +693,7 @@ implementation
|
||||
ps.register_sym;
|
||||
{ main are allways used }
|
||||
inc(ps.refs);
|
||||
st.insert(ps);
|
||||
st.insertsym(ps);
|
||||
pd:=tprocdef(cnodeutils.create_main_procdef(target_info.cprefix+name,potype,ps));
|
||||
{ We don't need a local symtable, change it into the static symtable }
|
||||
if not (potype in [potype_mainstub,potype_pkgstub,potype_libmainstub]) then
|
||||
@ -744,7 +744,7 @@ implementation
|
||||
gotvarsym:=cstaticvarsym.create('_GLOBAL_OFFSET_TABLE_',
|
||||
vs_value,voidpointertype,[vo_is_external]);
|
||||
gotvarsym.set_mangledname('_GLOBAL_OFFSET_TABLE_');
|
||||
current_module.localsymtable.insert(gotvarsym);
|
||||
current_module.localsymtable.insertsym(gotvarsym);
|
||||
{ avoid unnecessary warnings }
|
||||
gotvarsym.varstate:=vs_read;
|
||||
gotvarsym.refs:=1;
|
||||
@ -777,7 +777,7 @@ implementation
|
||||
|
||||
procedure copy_macro(p:TObject; arg:pointer);
|
||||
begin
|
||||
current_module.globalmacrosymtable.insert(tmacro(p).getcopy);
|
||||
current_module.globalmacrosymtable.insertsym(tmacro(p).getcopy);
|
||||
end;
|
||||
|
||||
function try_consume_hintdirective(var moduleopt:tmoduleoptions; var deprecatedmsg:pshortstring):boolean;
|
||||
@ -854,7 +854,7 @@ implementation
|
||||
include(def.objectoptions,oo_is_sealed);
|
||||
def.objextname:=stringdup(current_module.realmodulename^);
|
||||
typesym:=ctypesym.create('__FPC_JVM_Module_Class_Alias$',def);
|
||||
symtablestack.top.insert(typesym);
|
||||
symtablestack.top.insertsym(typesym);
|
||||
end;
|
||||
{$endif jvm}
|
||||
|
||||
@ -2154,7 +2154,7 @@ type
|
||||
for i:=0 to high(sc) do
|
||||
begin
|
||||
ps:=cprogramparasym.create(sc[i].name,sc[i].nr);
|
||||
current_module.localsymtable.insert(ps,true);
|
||||
current_module.localsymtable.insertsym(ps,true);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ implementation
|
||||
paranr:=paranr_result;
|
||||
{ Generate result variable accessing function result }
|
||||
vs:=cparavarsym.create('$result',paranr,vs_var,pd.returndef,[vo_is_funcret,vo_is_hidden_para]);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
{ Store this symbol as funcretsym for procedures }
|
||||
if pd.typ=procdef then
|
||||
tprocdef(pd).funcretsym:=vs;
|
||||
@ -164,7 +164,7 @@ implementation
|
||||
vs:=cparavarsym.create('$parentfp',paranr,vs_value,
|
||||
tprocdef(pd.owner.defowner).parentfpstructptrtype,[vo_is_parentfp,vo_is_hidden_para]);
|
||||
end;
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
|
||||
current_tokenpos:=storepos;
|
||||
end;
|
||||
@ -187,13 +187,13 @@ implementation
|
||||
begin
|
||||
{ insert Objective-C self and selector parameters }
|
||||
vs:=cparavarsym.create('$_cmd',paranr_objc_cmd,vs_value,objc_seltype,[vo_is_msgsel,vo_is_hidden_para]);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
{ make accessible to code }
|
||||
sl:=tpropaccesslist.create;
|
||||
sl.addsym(sl_load,vs);
|
||||
aliasvs:=cabsolutevarsym.create_ref('_CMD',objc_seltype,sl);
|
||||
include(aliasvs.varoptions,vo_is_msgsel);
|
||||
tlocalsymtable(tprocdef(pd).localst).insert(aliasvs);
|
||||
tlocalsymtable(tprocdef(pd).localst).insertsym(aliasvs);
|
||||
|
||||
if (po_classmethod in pd.procoptions) then
|
||||
{ compatible with what gcc does }
|
||||
@ -202,14 +202,14 @@ implementation
|
||||
hdef:=tprocdef(pd).struct;
|
||||
|
||||
vs:=cparavarsym.create('$self',paranr_objc_self,vs_value,hdef,[vo_is_self,vo_is_hidden_para]);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
end
|
||||
else if (pd.typ=procvardef) and
|
||||
pd.is_methodpointer then
|
||||
begin
|
||||
{ Generate self variable }
|
||||
vs:=cparavarsym.create('$self',paranr_self,vs_value,voidpointertype,[vo_is_self,vo_is_hidden_para]);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
end
|
||||
{ while only procvardefs of this type can be declared in Pascal code,
|
||||
internally we also generate procdefs of this type when creating
|
||||
@ -225,7 +225,7 @@ implementation
|
||||
vs:=cparavarsym.create('$_block_literal',paranr_blockselfpara,vs_value,
|
||||
hdef,[vo_is_hidden_para,vo_is_parentfp]
|
||||
);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
if pd.typ=procdef then
|
||||
begin
|
||||
{ make accessible to code }
|
||||
@ -233,7 +233,7 @@ implementation
|
||||
sl.addsym(sl_load,vs);
|
||||
aliasvs:=cabsolutevarsym.create_ref('FPC_BLOCK_SELF',hdef,sl);
|
||||
include(aliasvs.varoptions,vo_is_parentfp);
|
||||
tlocalsymtable(tprocdef(pd).localst).insert(aliasvs);
|
||||
tlocalsymtable(tprocdef(pd).localst).insertsym(aliasvs);
|
||||
end;
|
||||
end
|
||||
else
|
||||
@ -261,7 +261,7 @@ implementation
|
||||
)) then
|
||||
begin
|
||||
vs:=cparavarsym.create('$vmt',paranr_vmt,vs_value,cclassrefdef.create(tprocdef(pd).struct),[vo_is_vmt,vo_is_hidden_para]);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
end;
|
||||
|
||||
{ for helpers the type of Self is equivalent to the extended
|
||||
@ -286,7 +286,7 @@ implementation
|
||||
hdef:=selfdef;
|
||||
end;
|
||||
vs:=cparavarsym.create('$self',paranr_self,vsp,hdef,[vo_is_self,vo_is_hidden_para]);
|
||||
pd.parast.insert(vs);
|
||||
pd.parast.insertsym(vs);
|
||||
|
||||
current_tokenpos:=storepos;
|
||||
end;
|
||||
@ -319,7 +319,7 @@ implementation
|
||||
not paramanager.ret_in_param(pd.returndef,pd) then
|
||||
begin
|
||||
vs:=clocalvarsym.create('$result',vs_value,pd.returndef,[vo_is_funcret]);
|
||||
pd.localst.insert(vs);
|
||||
pd.localst.insertsym(vs);
|
||||
pd.funcretsym:=vs;
|
||||
end;
|
||||
|
||||
@ -336,7 +336,7 @@ implementation
|
||||
sl.addsym(sl_load,pd.funcretsym);
|
||||
aliasvs:=cabsolutevarsym.create_ref(hs,pd.returndef,sl);
|
||||
include(aliasvs.varoptions,vo_is_funcret);
|
||||
tlocalsymtable(pd.localst).insert(aliasvs);
|
||||
tlocalsymtable(pd.localst).insertsym(aliasvs);
|
||||
end;
|
||||
|
||||
{ insert result also if support is on }
|
||||
@ -347,7 +347,7 @@ implementation
|
||||
aliasvs:=cabsolutevarsym.create_ref('RESULT',pd.returndef,sl);
|
||||
include(aliasvs.varoptions,vo_is_funcret);
|
||||
include(aliasvs.varoptions,vo_is_result);
|
||||
tlocalsymtable(pd.localst).insert(aliasvs);
|
||||
tlocalsymtable(pd.localst).insertsym(aliasvs);
|
||||
end;
|
||||
|
||||
end;
|
||||
@ -366,7 +366,7 @@ implementation
|
||||
variable it not needed at all, but that the HRESULT is set when the method
|
||||
is finalized) }
|
||||
vs.varregable:=vr_none;
|
||||
pd.localst.insert(vs);
|
||||
pd.localst.insertsym(vs);
|
||||
end;
|
||||
|
||||
current_tokenpos:=storepos;
|
||||
@ -407,7 +407,7 @@ implementation
|
||||
begin
|
||||
hvs:=cparavarsym.create('$high'+name,paranr+1,vs_const,sizesinttype,[vo_is_high_para,vo_is_hidden_para]);
|
||||
hvs.symoptions:=[];
|
||||
owner.insert(hvs);
|
||||
owner.insertsym(hvs);
|
||||
{ don't place to register if it will be accessed from implicit finally block }
|
||||
if (varspez=vs_value) and
|
||||
is_open_array(vardef) and
|
||||
@ -435,7 +435,7 @@ implementation
|
||||
begin
|
||||
hvs:=cparavarsym.create('$typinfo'+name,paranr+1,vs_const,voidpointertype,
|
||||
[vo_is_typinfo_para,vo_is_hidden_para]);
|
||||
owner.insert(hvs);
|
||||
owner.insertsym(hvs);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -898,7 +898,7 @@ implementation
|
||||
symentry:=currpd.parast.Find('self');
|
||||
if symentry<>nil then
|
||||
begin
|
||||
currpd.parast.Delete(symentry);
|
||||
currpd.parast.DeleteSym(symentry);
|
||||
currpd.calcparas;
|
||||
end;
|
||||
end;
|
||||
@ -1229,7 +1229,7 @@ implementation
|
||||
begin
|
||||
nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[]);
|
||||
include(nestedvars.symoptions,sp_internal);
|
||||
pd.localst.insert(nestedvars);
|
||||
pd.localst.insertsym(nestedvars);
|
||||
pd.parentfpstruct:=nestedvars;
|
||||
pd.parentfpinitblock:=cblocknode.create(nil);
|
||||
end;
|
||||
|
||||
@ -81,7 +81,7 @@ implementation
|
||||
include(result.procoptions,po_hascallingconvention);
|
||||
handle_calling_convention(result,hcc_default_actions_impl);
|
||||
sym:=cprocsym.create(basesymname+result.unique_id_str);
|
||||
st.insert(sym);
|
||||
st.insertsym(sym);
|
||||
|
||||
result.procsym:=sym;
|
||||
proc_add_definition(result);
|
||||
|
||||
@ -994,7 +994,7 @@ implementation
|
||||
end;
|
||||
excepTSymtable:=tstt_excepTSymtable.create;
|
||||
excepTSymtable.defowner:=current_procinfo.procdef;
|
||||
excepTSymtable.insert(sym);
|
||||
excepTSymtable.insertsym(sym);
|
||||
symtablestack.push(excepTSymtable);
|
||||
end
|
||||
else
|
||||
|
||||
@ -779,7 +779,7 @@ implementation
|
||||
if is_class(procdef.struct) then
|
||||
begin
|
||||
constructionsuccessful:=clocalvarsym.create(internaltypeprefixName[itp_vmt_afterconstruction_local],vs_value,ptrsinttype,[]);
|
||||
procdef.localst.insert(constructionsuccessful,false);
|
||||
procdef.localst.insertsym(constructionsuccessful,false);
|
||||
srsym:=search_struct_member(procdef.struct,'AFTERCONSTRUCTION');
|
||||
if not assigned(srsym) or
|
||||
(srsym.typ<>procsym) then
|
||||
|
||||
@ -53,70 +53,70 @@ implementation
|
||||
all intern procedures for the system unit
|
||||
}
|
||||
begin
|
||||
systemunit.insert(csyssym.create('Concat',in_concat_x));
|
||||
systemunit.insert(csyssym.create('Write',in_write_x));
|
||||
systemunit.insert(csyssym.create('WriteLn',in_writeln_x));
|
||||
systemunit.insert(csyssym.create('WriteStr',in_writestr_x));
|
||||
systemunit.insert(csyssym.create('Assigned',in_assigned_x));
|
||||
systemunit.insert(csyssym.create('Read',in_read_x));
|
||||
systemunit.insert(csyssym.create('ReadLn',in_readln_x));
|
||||
systemunit.insert(csyssym.create('ReadStr',in_readstr_x));
|
||||
systemunit.insert(csyssym.create('Ofs',in_ofs_x));
|
||||
systemunit.insert(csyssym.create('SizeOf',in_sizeof_x));
|
||||
systemunit.insert(csyssym.create('BitSizeOf',in_bitsizeof_x));
|
||||
systemunit.insert(csyssym.create('TypeOf',in_typeof_x));
|
||||
systemunit.insert(csyssym.create('Low',in_low_x));
|
||||
systemunit.insert(csyssym.create('High',in_high_x));
|
||||
systemunit.insert(csyssym.create('Slice',in_slice_x));
|
||||
systemunit.insert(csyssym.create('Seg',in_seg_x));
|
||||
systemunit.insert(csyssym.create('Ord',in_ord_x));
|
||||
systemunit.insert(csyssym.create('Chr',in_chr_byte));
|
||||
systemunit.insert(csyssym.create('Pred',in_pred_x));
|
||||
systemunit.insert(csyssym.create('Succ',in_succ_x));
|
||||
systemunit.insert(csyssym.create('Exclude',in_exclude_x_y));
|
||||
systemunit.insert(csyssym.create('Include',in_include_x_y));
|
||||
systemunit.insert(csyssym.create('Pack',in_pack_x_y_z));
|
||||
systemunit.insert(csyssym.create('Unpack',in_unpack_x_y_z));
|
||||
systemunit.insert(csyssym.create('Break',in_break));
|
||||
systemunit.insert(csyssym.create('Exit',in_exit));
|
||||
systemunit.insert(csyssym.create('Continue',in_continue));
|
||||
systemunit.insert(csyssym.create('Leave',in_leave)); {macpas only}
|
||||
systemunit.insert(csyssym.create('Cycle',in_cycle)); {macpas only}
|
||||
systemunit.insert(csyssym.create('Dec',in_dec_x));
|
||||
systemunit.insert(csyssym.create('Inc',in_inc_x));
|
||||
systemunit.insert(csyssym.create('Str',in_str_x_string));
|
||||
systemunit.insert(csyssym.create('Assert',in_assert_x_y));
|
||||
systemunit.insert(csyssym.create('Val',in_val_x));
|
||||
systemunit.insert(csyssym.create('Addr',in_addr_x));
|
||||
systemunit.insertsym(csyssym.create('Concat',in_concat_x));
|
||||
systemunit.insertsym(csyssym.create('Write',in_write_x));
|
||||
systemunit.insertsym(csyssym.create('WriteLn',in_writeln_x));
|
||||
systemunit.insertsym(csyssym.create('WriteStr',in_writestr_x));
|
||||
systemunit.insertsym(csyssym.create('Assigned',in_assigned_x));
|
||||
systemunit.insertsym(csyssym.create('Read',in_read_x));
|
||||
systemunit.insertsym(csyssym.create('ReadLn',in_readln_x));
|
||||
systemunit.insertsym(csyssym.create('ReadStr',in_readstr_x));
|
||||
systemunit.insertsym(csyssym.create('Ofs',in_ofs_x));
|
||||
systemunit.insertsym(csyssym.create('SizeOf',in_sizeof_x));
|
||||
systemunit.insertsym(csyssym.create('BitSizeOf',in_bitsizeof_x));
|
||||
systemunit.insertsym(csyssym.create('TypeOf',in_typeof_x));
|
||||
systemunit.insertsym(csyssym.create('Low',in_low_x));
|
||||
systemunit.insertsym(csyssym.create('High',in_high_x));
|
||||
systemunit.insertsym(csyssym.create('Slice',in_slice_x));
|
||||
systemunit.insertsym(csyssym.create('Seg',in_seg_x));
|
||||
systemunit.insertsym(csyssym.create('Ord',in_ord_x));
|
||||
systemunit.insertsym(csyssym.create('Chr',in_chr_byte));
|
||||
systemunit.insertsym(csyssym.create('Pred',in_pred_x));
|
||||
systemunit.insertsym(csyssym.create('Succ',in_succ_x));
|
||||
systemunit.insertsym(csyssym.create('Exclude',in_exclude_x_y));
|
||||
systemunit.insertsym(csyssym.create('Include',in_include_x_y));
|
||||
systemunit.insertsym(csyssym.create('Pack',in_pack_x_y_z));
|
||||
systemunit.insertsym(csyssym.create('Unpack',in_unpack_x_y_z));
|
||||
systemunit.insertsym(csyssym.create('Break',in_break));
|
||||
systemunit.insertsym(csyssym.create('Exit',in_exit));
|
||||
systemunit.insertsym(csyssym.create('Continue',in_continue));
|
||||
systemunit.insertsym(csyssym.create('Leave',in_leave)); {macpas only}
|
||||
systemunit.insertsym(csyssym.create('Cycle',in_cycle)); {macpas only}
|
||||
systemunit.insertsym(csyssym.create('Dec',in_dec_x));
|
||||
systemunit.insertsym(csyssym.create('Inc',in_inc_x));
|
||||
systemunit.insertsym(csyssym.create('Str',in_str_x_string));
|
||||
systemunit.insertsym(csyssym.create('Assert',in_assert_x_y));
|
||||
systemunit.insertsym(csyssym.create('Val',in_val_x));
|
||||
systemunit.insertsym(csyssym.create('Addr',in_addr_x));
|
||||
{$ifdef i8086}
|
||||
systemunit.insert(csyssym.create('FarAddr',in_faraddr_x));
|
||||
systemunit.insertsym(csyssym.create('FarAddr',in_faraddr_x));
|
||||
{$endif i8086}
|
||||
systemunit.insert(csyssym.create('TypeInfo',in_typeinfo_x));
|
||||
systemunit.insert(csyssym.create('SetLength',in_setlength_x));
|
||||
systemunit.insert(csyssym.create('Copy',in_copy_x));
|
||||
systemunit.insert(csyssym.create('Initialize',in_initialize_x));
|
||||
systemunit.insert(csyssym.create('Finalize',in_finalize_x));
|
||||
systemunit.insert(csyssym.create('Length',in_length_x));
|
||||
systemunit.insert(csyssym.create('New',in_new_x));
|
||||
systemunit.insert(csyssym.create('Dispose',in_dispose_x));
|
||||
systemunit.insertsym(csyssym.create('TypeInfo',in_typeinfo_x));
|
||||
systemunit.insertsym(csyssym.create('SetLength',in_setlength_x));
|
||||
systemunit.insertsym(csyssym.create('Copy',in_copy_x));
|
||||
systemunit.insertsym(csyssym.create('Initialize',in_initialize_x));
|
||||
systemunit.insertsym(csyssym.create('Finalize',in_finalize_x));
|
||||
systemunit.insertsym(csyssym.create('Length',in_length_x));
|
||||
systemunit.insertsym(csyssym.create('New',in_new_x));
|
||||
systemunit.insertsym(csyssym.create('Dispose',in_dispose_x));
|
||||
{$ifdef SUPPORT_GET_FRAME}
|
||||
systemunit.insert(csyssym.create('Get_Frame',in_get_frame));
|
||||
systemunit.insertsym(csyssym.create('Get_Frame',in_get_frame));
|
||||
{$endif SUPPORT_GET_FRAME}
|
||||
systemunit.insert(csyssym.create('Unaligned',in_unaligned_x));
|
||||
systemunit.insert(csyssym.create('Aligned',in_aligned_x));
|
||||
systemunit.insert(csyssym.create('Volatile',in_volatile_x));
|
||||
systemunit.insert(csyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
|
||||
systemunit.insert(csyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
|
||||
systemunit.insert(csyssym.create('Default',in_default_x));
|
||||
systemunit.insert(csyssym.create('SetString',in_setstring_x_y_z));
|
||||
systemunit.insert(csyssym.create('Insert',in_insert_x_y_z));
|
||||
systemunit.insert(csyssym.create('Delete',in_delete_x_y_z));
|
||||
systemunit.insert(csyssym.create('GetTypeKind',in_gettypekind_x));
|
||||
systemunit.insert(csyssym.create('IsManagedType',in_ismanagedtype_x));
|
||||
systemunit.insert(csyssym.create('IsConstValue',in_isconstvalue_x));
|
||||
systemunit.insert(csyssym.create('fpc_eh_return_data_regno', in_const_eh_return_data_regno));
|
||||
systemunit.insert(cconstsym.create_ord('False',constord,0,pasbool1type));
|
||||
systemunit.insert(cconstsym.create_ord('True',constord,1,pasbool1type));
|
||||
systemunit.insertsym(csyssym.create('Unaligned',in_unaligned_x));
|
||||
systemunit.insertsym(csyssym.create('Aligned',in_aligned_x));
|
||||
systemunit.insertsym(csyssym.create('Volatile',in_volatile_x));
|
||||
systemunit.insertsym(csyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
|
||||
systemunit.insertsym(csyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
|
||||
systemunit.insertsym(csyssym.create('Default',in_default_x));
|
||||
systemunit.insertsym(csyssym.create('SetString',in_setstring_x_y_z));
|
||||
systemunit.insertsym(csyssym.create('Insert',in_insert_x_y_z));
|
||||
systemunit.insertsym(csyssym.create('Delete',in_delete_x_y_z));
|
||||
systemunit.insertsym(csyssym.create('GetTypeKind',in_gettypekind_x));
|
||||
systemunit.insertsym(csyssym.create('IsManagedType',in_ismanagedtype_x));
|
||||
systemunit.insertsym(csyssym.create('IsConstValue',in_isconstvalue_x));
|
||||
systemunit.insertsym(csyssym.create('fpc_eh_return_data_regno', in_const_eh_return_data_regno));
|
||||
systemunit.insertsym(cconstsym.create_ord('False',constord,0,pasbool1type));
|
||||
systemunit.insertsym(cconstsym.create_ord('True',constord,1,pasbool1type));
|
||||
end;
|
||||
|
||||
|
||||
@ -228,12 +228,12 @@ implementation
|
||||
function addtype(const s:string;def:tdef):ttypesym;
|
||||
begin
|
||||
result:=ctypesym.create(s,def);
|
||||
systemunit.insert(result);
|
||||
systemunit.insertsym(result);
|
||||
end;
|
||||
|
||||
procedure addfield(recst:tabstractrecordsymtable;sym:tfieldvarsym);
|
||||
begin
|
||||
recst.insert(sym);
|
||||
recst.insertsym(sym);
|
||||
recst.addfield(sym,vis_hidden);
|
||||
end;
|
||||
|
||||
@ -647,7 +647,7 @@ implementation
|
||||
{ can't use addtype for pvmt because the rtti of the pointed
|
||||
type is not available. The rtti for pvmt will be written implicitly
|
||||
by thev tblarray below }
|
||||
systemunit.insert(ctypesym.create('$'+pvmt_name,pvmttype));
|
||||
systemunit.insertsym(ctypesym.create('$'+pvmt_name,pvmttype));
|
||||
addfield(hrecst,cfieldvarsym.create('$length',vs_value,sizesinttype,[]));
|
||||
addfield(hrecst,cfieldvarsym.create('$mlength',vs_value,sizesinttype,[]));
|
||||
addfield(hrecst,cfieldvarsym.create('$parent',vs_value,pvmttype,[]));
|
||||
|
||||
@ -1758,9 +1758,9 @@ implementation
|
||||
Message(parser_w_enumeration_out_of_range)
|
||||
else
|
||||
Message(parser_e_enumeration_out_of_range);
|
||||
tenumsymtable(aktenumdef.symtable).insert(cenumsym.create(s,aktenumdef,longint(l.svalue)));
|
||||
tenumsymtable(aktenumdef.symtable).insertsym(cenumsym.create(s,aktenumdef,longint(l.svalue)));
|
||||
if not (cs_scopedenums in current_settings.localswitches) then
|
||||
tstoredsymtable(aktenumdef.owner).insert(cenumsym.create(s,aktenumdef,longint(l.svalue)));
|
||||
tstoredsymtable(aktenumdef.owner).insertsym(cenumsym.create(s,aktenumdef,longint(l.svalue)));
|
||||
current_tokenpos:=storepos;
|
||||
end;
|
||||
until not try_to_consume(_COMMA);
|
||||
|
||||
@ -2309,7 +2309,7 @@ type
|
||||
begin
|
||||
mac:=tmacro.create(hs);
|
||||
mac.defined:=true;
|
||||
current_module.localmacrosymtable.insert(mac);
|
||||
current_module.localmacrosymtable.insertsym(mac);
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -2419,7 +2419,7 @@ type
|
||||
mac:=tmacro.create(hs);
|
||||
mac.defined:=true;
|
||||
mac.is_compiler_var:=true;
|
||||
current_module.localmacrosymtable.insert(mac);
|
||||
current_module.localmacrosymtable.insertsym(mac);
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -2495,7 +2495,7 @@ type
|
||||
begin
|
||||
mac:=tmacro.create(hs);
|
||||
mac.defined:=false;
|
||||
current_module.localmacrosymtable.insert(mac);
|
||||
current_module.localmacrosymtable.insertsym(mac);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
@ -112,8 +112,8 @@ interface
|
||||
function getcopy:TSymtable;
|
||||
procedure clear;virtual;
|
||||
function checkduplicate(var s:THashedIDString;sym:TSymEntry):boolean;virtual;
|
||||
procedure insert(sym:TSymEntry;checkdup:boolean=true);virtual;
|
||||
procedure Delete(sym:TSymEntry);virtual;
|
||||
procedure insertsym(sym:TSymEntry;checkdup:boolean=true);virtual;
|
||||
procedure Deletesym(sym:TSymEntry);virtual;
|
||||
function Find(const s:TIDString) : TSymEntry;
|
||||
function FindWithHash(const s:THashedIDString) : TSymEntry;virtual;
|
||||
procedure insertdef(def:TDefEntry);virtual;
|
||||
@ -344,7 +344,7 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure TSymtable.insert(sym:TSymEntry;checkdup:boolean=true);
|
||||
procedure TSymtable.insertsym(sym:TSymEntry;checkdup:boolean=true);
|
||||
var
|
||||
hashedid : THashedIDString;
|
||||
begin
|
||||
@ -368,7 +368,7 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure TSymtable.Delete(sym:TSymEntry);
|
||||
procedure TSymtable.Deletesym(sym:TSymEntry);
|
||||
begin
|
||||
if sym.Owner<>self then
|
||||
internalerror(200611121);
|
||||
|
||||
@ -1203,7 +1203,7 @@ implementation
|
||||
else
|
||||
begin
|
||||
ps:=cprocsym.create(realname);
|
||||
newparentst.insert(ps);
|
||||
newparentst.insertsym(ps);
|
||||
end;
|
||||
pd.procsym:=ps;
|
||||
pd.struct:=newstruct;
|
||||
@ -1275,7 +1275,7 @@ implementation
|
||||
result:=cfieldvarsym.create(symrealname,vs_value,fieldvardef,[]);
|
||||
if nestedvarsst.symlist.count=0 then
|
||||
include(tfieldvarsym(result).varoptions,vo_is_first_field);
|
||||
nestedvarsst.insert(result);
|
||||
nestedvarsst.insertsym(result);
|
||||
trecordsymtable(nestedvarsst).addfield(tfieldvarsym(result),vis_public);
|
||||
|
||||
{ add initialization with original value if it's a parameter }
|
||||
@ -1341,7 +1341,7 @@ implementation
|
||||
routine; ignore duplicates, because this will also check the
|
||||
parasymtable and we want to override parameters with our local
|
||||
versions }
|
||||
pd.localst.insert(aliassym,false);
|
||||
pd.localst.insertsym(aliassym,false);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1380,7 +1380,7 @@ implementation
|
||||
since a subscriptn requires something to subscript and
|
||||
there is nothing in this case (class+field name will be
|
||||
encoded in the mangled symbol name) }
|
||||
recst.insert(hstaticvs);
|
||||
recst.insertsym(hstaticvs);
|
||||
{ only set the staticvarsym's basename (= field name, without any
|
||||
mangling), because generating the fully mangled name right now can
|
||||
result in a wrong string in case the field's type is a forward
|
||||
@ -1395,9 +1395,9 @@ implementation
|
||||
{$else jvm}
|
||||
include(hstaticvs.symoptions,sp_internal);
|
||||
if df_generic in tdef(recst.defowner).defoptions then
|
||||
tabstractrecordsymtable(recst).insert(hstaticvs)
|
||||
tabstractrecordsymtable(recst).insertsym(hstaticvs)
|
||||
else
|
||||
tdef(tabstractrecordsymtable(recst).defowner).get_top_level_symtable(false).insert(hstaticvs);
|
||||
tdef(tabstractrecordsymtable(recst).defowner).get_top_level_symtable(false).insertsym(hstaticvs);
|
||||
{$endif jvm}
|
||||
{ generate the symbol for the access }
|
||||
sl:=tpropaccesslist.create;
|
||||
@ -1409,7 +1409,7 @@ implementation
|
||||
is_visible_for_object), which means that the load will fail if this
|
||||
symbol is e.g. "strict private" while the property is public }
|
||||
tmp:=cabsolutevarsym.create_ref('$'+static_name,fieldvs.vardef,sl);
|
||||
recst.insert(tmp);
|
||||
recst.insertsym(tmp);
|
||||
result:=hstaticvs;
|
||||
end;
|
||||
|
||||
@ -1487,7 +1487,7 @@ implementation
|
||||
ps.register_sym;
|
||||
{ the RTTI always references this symbol }
|
||||
inc(ps.refs);
|
||||
current_module.localsymtable.insert(ps);
|
||||
current_module.localsymtable.insertsym(ps);
|
||||
pd:=cprocdef.create(normal_function_level,true);
|
||||
{ always register the def }
|
||||
pd.register_def;
|
||||
|
||||
@ -5099,7 +5099,7 @@ implementation
|
||||
{ avoid hints about unused types (these may only be used for
|
||||
typed constant data) }
|
||||
ts.increfcount;
|
||||
where.insert(ts);
|
||||
where.insertsym(ts);
|
||||
end;
|
||||
symtablestack:=oldsymtablestack;
|
||||
{ don't create RTTI for internal types, these are not exported }
|
||||
@ -5122,7 +5122,7 @@ implementation
|
||||
else
|
||||
pname:=@optionalname;
|
||||
sym:=cfieldvarsym.create(pname^,vs_value,def,[]);
|
||||
symtable.insert(sym);
|
||||
symtable.insertsym(sym);
|
||||
trecordsymtable(symtable).addfield(sym,vis_hidden);
|
||||
result:=sym;
|
||||
end;
|
||||
@ -5799,7 +5799,7 @@ implementation
|
||||
npvs:=cparavarsym.create('$high'+paraprefix+copy(pvs.name,5,length(pvs.name)),pvs.paranr,pvs.varspez,
|
||||
pvs.vardef,pvs.varoptions);
|
||||
npvs.defaultconstsym:=pvs.defaultconstsym;
|
||||
tabstractprocdef(result).parast.insert(npvs);
|
||||
tabstractprocdef(result).parast.insertsym(npvs);
|
||||
end;
|
||||
constsym:
|
||||
begin
|
||||
@ -7852,7 +7852,7 @@ implementation
|
||||
in the implementation, and they cannot be merged since only
|
||||
the once in the interface must be saved to the ppu/visible
|
||||
from other units }
|
||||
st.insert(psym,false);
|
||||
st.insertsym(psym,false);
|
||||
end
|
||||
else if (psym.typ<>procsym) then
|
||||
internalerror(2009111501);
|
||||
@ -7974,7 +7974,7 @@ implementation
|
||||
end;
|
||||
vmt_field:=cfieldvarsym.create('_vptr$'+objname^,vs_value,voidpointertype,[]);
|
||||
hidesym(vmt_field);
|
||||
tObjectSymtable(symtable).insert(vmt_field);
|
||||
tObjectSymtable(symtable).insertsym(vmt_field);
|
||||
tObjectSymtable(symtable).addfield(tfieldvarsym(vmt_field),vis_hidden);
|
||||
include(objectoptions,oo_has_vmt);
|
||||
end;
|
||||
|
||||
@ -1633,12 +1633,12 @@ implementation
|
||||
if assigned(readprocdef) then
|
||||
begin
|
||||
hparavs:=cparavarsym.create(orig.RealName,orig.paranr,orig.varspez,orig.vardef,[]);
|
||||
readprocdef.parast.insert(hparavs);
|
||||
readprocdef.parast.insertsym(hparavs);
|
||||
end;
|
||||
if assigned(writeprocdef) then
|
||||
begin
|
||||
hparavs:=cparavarsym.create(orig.RealName,orig.paranr,orig.varspez,orig.vardef,[]);
|
||||
writeprocdef.parast.insert(hparavs);
|
||||
writeprocdef.parast.insertsym(hparavs);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1652,12 +1652,12 @@ implementation
|
||||
if assigned(readprocdef) then
|
||||
begin
|
||||
hparavs:=cparavarsym.create('$index',10*paranr,vs_value,indexdef,[]);
|
||||
readprocdef.parast.insert(hparavs);
|
||||
readprocdef.parast.insertsym(hparavs);
|
||||
end;
|
||||
if assigned(writeprocdef) then
|
||||
begin
|
||||
hparavs:=cparavarsym.create('$index',10*paranr,vs_value,indexdef,[]);
|
||||
writeprocdef.parast.insert(hparavs);
|
||||
writeprocdef.parast.insertsym(hparavs);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -55,8 +55,8 @@ interface
|
||||
procedure writesyms(ppufile:tcompilerppufile);
|
||||
public
|
||||
constructor create(const s:string);
|
||||
procedure insert(sym:TSymEntry;checkdup:boolean=true);override;
|
||||
procedure delete(sym:TSymEntry);override;
|
||||
procedure insertsym(sym:TSymEntry;checkdup:boolean=true);override;
|
||||
procedure deletesym(sym:TSymEntry);override;
|
||||
{ load/write }
|
||||
procedure ppuload(ppufile:tcompilerppufile);virtual;
|
||||
procedure ppuwrite(ppufile:tcompilerppufile);virtual;
|
||||
@ -291,7 +291,7 @@ interface
|
||||
|
||||
tenumsymtable = class(tabstractsubsymtable)
|
||||
public
|
||||
procedure insert(sym: TSymEntry; checkdup: boolean = true); override;
|
||||
procedure insertsym(sym: TSymEntry; checkdup: boolean = true); override;
|
||||
constructor create(adefowner:tdef);
|
||||
end;
|
||||
|
||||
@ -506,16 +506,16 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure tstoredsymtable.insert(sym:TSymEntry;checkdup:boolean=true);
|
||||
procedure tstoredsymtable.insertsym(sym:TSymEntry;checkdup:boolean=true);
|
||||
begin
|
||||
inherited insert(sym,checkdup);
|
||||
inherited insertsym(sym,checkdup);
|
||||
init_final_check_done:=false;
|
||||
end;
|
||||
|
||||
|
||||
procedure tstoredsymtable.delete(sym:TSymEntry);
|
||||
procedure tstoredsymtable.deletesym(sym:TSymEntry);
|
||||
begin
|
||||
inherited delete(sym);
|
||||
inherited deletesym(sym);
|
||||
init_final_check_done:=false;
|
||||
end;
|
||||
|
||||
@ -635,7 +635,7 @@ implementation
|
||||
end;
|
||||
if assigned(sym) then
|
||||
tstoredsym(sym).ppuload_subentries(ppufile);
|
||||
Insert(sym,false);
|
||||
InsertSym(sym,false);
|
||||
until false;
|
||||
end;
|
||||
|
||||
@ -1885,7 +1885,7 @@ implementation
|
||||
|
||||
{ add to this record symtable, checking for duplicate names }
|
||||
// unionst.SymList.List.List^[i].Data:=nil;
|
||||
insert(sym);
|
||||
insertsym(sym);
|
||||
varalign:=tfieldvarsym(sym).vardef.alignment;
|
||||
if varalign=0 then
|
||||
varalign:=size_2_align(tfieldvarsym(sym).getsize);
|
||||
@ -2635,7 +2635,7 @@ implementation
|
||||
n,ns:string;
|
||||
oldsym:TSymEntry;
|
||||
begin
|
||||
insert(sym);
|
||||
insertsym(sym);
|
||||
n:=sym.realname;
|
||||
p:=pos('.',n);
|
||||
ns:='';
|
||||
@ -2648,7 +2648,7 @@ implementation
|
||||
system.delete(n,1,p);
|
||||
oldsym:=findnamespace(upper(ns));
|
||||
if not assigned(oldsym) then
|
||||
insert(cnamespacesym.create(ns));
|
||||
insertsym(cnamespacesym.create(ns));
|
||||
p:=pos('.',n);
|
||||
end;
|
||||
end;
|
||||
@ -2847,7 +2847,7 @@ implementation
|
||||
TEnumSymtable
|
||||
****************************************************************************}
|
||||
|
||||
procedure tenumsymtable.insert(sym: TSymEntry; checkdup: boolean);
|
||||
procedure tenumsymtable.insertsym(sym: TSymEntry; checkdup: boolean);
|
||||
var
|
||||
value: longint;
|
||||
def: tenumdef;
|
||||
@ -2877,7 +2877,7 @@ implementation
|
||||
def.setmax(value);
|
||||
end;
|
||||
end;
|
||||
inherited insert(sym, checkdup);
|
||||
inherited insertsym(sym, checkdup);
|
||||
end;
|
||||
|
||||
constructor tenumsymtable.create(adefowner: tdef);
|
||||
@ -4705,9 +4705,9 @@ implementation
|
||||
begin
|
||||
mac:=tmacro.create(s);
|
||||
if assigned(current_module) then
|
||||
current_module.localmacrosymtable.insert(mac)
|
||||
current_module.localmacrosymtable.insertsym(mac)
|
||||
else
|
||||
initialmacrosymtable.insert(mac);
|
||||
initialmacrosymtable.insertsym(mac);
|
||||
end;
|
||||
Message1(parser_c_macro_defined,mac.name);
|
||||
mac.defined:=true;
|
||||
@ -4727,9 +4727,9 @@ implementation
|
||||
begin
|
||||
mac:=tmacro.create(s);
|
||||
if assigned(current_module) then
|
||||
current_module.localmacrosymtable.insert(mac)
|
||||
current_module.localmacrosymtable.insertsym(mac)
|
||||
else
|
||||
initialmacrosymtable.insert(mac);
|
||||
initialmacrosymtable.insertsym(mac);
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -4759,9 +4759,9 @@ implementation
|
||||
mac:=tmacro.create(s);
|
||||
mac.is_compiler_var:=true;
|
||||
if assigned(current_module) then
|
||||
current_module.localmacrosymtable.insert(mac)
|
||||
current_module.localmacrosymtable.insertsym(mac)
|
||||
else
|
||||
initialmacrosymtable.insert(mac);
|
||||
initialmacrosymtable.insertsym(mac);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
@ -136,7 +136,7 @@ implementation
|
||||
not assigned(def.typesym) then
|
||||
begin
|
||||
ts:=ctypesym.create(trecorddef(def).symtable.realname^,def);
|
||||
st.insert(ts);
|
||||
st.insertsym(ts);
|
||||
ts.visibility:=vis_strictprivate;
|
||||
{ this typesym can't be used by any Pascal code, so make sure we don't
|
||||
print a hint about it being unused }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user