Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file visibility.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889(**************************************************************************)(* *)(* SPDX-License-Identifier LGPL-2.1 *)(* Copyright (C) *)(* CEA (Commissariat à l'énergie atomique et aux énergies alternatives) *)(* *)(**************************************************************************)openCil_typesopenAst_constclassto_visibilitypc_label=object(self)inheritVisitor.frama_c_inplacevalmutableto_add_vInfo=[]valmutableto_add_ret=None,[]valunk_loc=Cil_datatype.Location.unknownmethod!vvdecv=ifv.vname="__retres"thenv.vname<-"__retres_hidden_from_pc_view";SkipChildrenmethodprivatemk_init?(loc=unk_loc)vivalue=Local_init(vi,AssignInit(SingleInit(value)),loc)|>Stmt_builder.instrmethodprivatemk_comp?(loc=unk_loc)opvivalue=letnew_exp=Cil.new_exp~loc(Lval(Varvi,NoOffset))inExp_builder.binopopnew_expvaluemethod!vfunc_=Cil.DoChildrenPost(funf->letinits=List.map(fun(vi,_,_)->self#mk_initvi(Cil.zero~loc:unk_loc))to_add_vInfointo_add_vInfo<-[];to_add_ret<-None,[];f.sbody.bstmts<-inits@f.sbody.bstmts;f)method!vblock_=Cil.DoChildrenPost(funblock->matchto_add_retwith|None,_|Some_,[]->block|Somes,lbls->letrecauxlacc=matchlwith|[]->acc|s'::twhenCil_datatype.Stmt.equalss'->s'.skind<-Block(Cil.mkBlock(lbls@[Stmt_builder.mks'.skind]));auxt(acc@[s'])|s'::t->auxt(acc@[s'])inblock.bstmts<-auxblock.bstmts[];block)method!vstmt_auxs=matchs.skindwith|Instr(Call(_,Var{vname=name},[cond;{enode=Const(CInt64(id,IInt,None))}asidExp;tagExp],loc))whenString.equalname"pc_label"->letvname="__SEQ_VISIBILITY_"^(string_of_int(Integer.to_int_exnid))inletpred_vInfo=Cil.makeVarinfofalsefalsevnameCil_const.intTypeinletexp_vInfo=Exp_builder.lval~loc(Varpred_vInfo,NoOffset)inletkeep_covered=Exp_builder.binop~locLOrexp_vInfocondinletset=Ast_info.mkassign(Varpred_vInfo,NoOffset)keep_coveredlocinto_add_vInfo<-to_add_vInfo@[(pred_vInfo,idExp,tagExp)];s.skind<-Instrset;Cil.SkipChildren|Return(_,loc)->letlbls=List.map(fun(vi,id,tag)->letcond=self#mk_comp~locNevi(Cil.zero~loc)inUtils.mk_callpc_label[cond;id;tag])to_add_vInfointo_add_ret<-(Somes,lbls);Cil.SkipChildren|_->Cil.DoChildrenendletto_visibilityastpc_label=Visitor.visitFramacFileSameGlobals(newto_visibilitypc_label:>Visitor.frama_c_visitor)ast