Forum > FPC development

Code cleanup at class procedure tnodeutils.InsertThreadvars;

(1/1)

lagprogramming:
compiler/ngenutil.pas has

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  class procedure tnodeutils.InsertThreadvars;    var      s : TSymStr;      tcb: ttai_typedconstbuilder;      sym: tasmsymbol;      tabledef: trecorddef;      add : boolean;    begin       if (tf_section_threadvars in target_info.flags) then         exit;       tcb:=ctai_typedconstbuilder.create([tcalo_make_dead_strippable,tcalo_new_section]);       tabledef:=tcb.begin_anonymous_record('',default_settings.packrecords,voidpointertype.alignment,targetinfos[target_info.system]^.alignment.recordalignmin);       if assigned(current_module.globalsymtable) then         current_module.globalsymtable.SymList.ForEachCall(@AddToThreadvarList,tcb);       current_module.localsymtable.SymList.ForEachCall(@AddToThreadvarList,tcb);       if trecordsymtable(tabledef.symtable).datasize<>0 then         { terminator }         tcb.emit_tai(tai_const.Create_nil_dataptr,voidpointertype);       tcb.end_anonymous_record;       add:=trecordsymtable(tabledef.symtable).datasize<>0;       if add then         begin           s:=make_mangledname('THREADVARLIST',current_module.localsymtable,'');           sym:=current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA_FORCEINDIRECT,tabledef);           current_asmdata.asmlists[al_globals].concatlist(             tcb.get_final_asmlist(sym,tabledef,sec_data,s,const_align(sizeof(pint))));           include(current_module.moduleflags,mf_threadvars);           current_module.add_public_asmsym(sym);         end       else         s:='';       tcb.Free;    end;
The attached patch removes the useless "else s:='';" at the end of the procedure.

AlexTP:
Reported to https://gitlab.com/freepascal.org/fpc/source/-/issues/40538

Navigation

[0] Message Index

Go to full version