MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / walk

Method walk

src/simulate/simulate_gc.cpp:171–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 virtual void beforeIterator ( Iterator * ) {}
170
171 virtual void walk ( char * pa, TypeInfo * info ) override {
172 if ( pa == nullptr ) {
173 } else if ( info->flags & TypeInfo::flag_ref ) {
174 beforeRef(pa,info);
175 TypeInfo ti = *info;
176 ti.flags &= ~TypeInfo::flag_ref;
177 walk(*(char **)pa, &ti);
178 ti.flags |= TypeInfo::flag_ref;
179 afterRef(pa,info);
180 } else if ( info->dimSize ) {
181 walk_dim(pa, info);
182 } else {
183 switch ( info->type ) {
184 case Type::tArray: {
185 auto arr = (Array *) pa;
186 beforeArray(arr, info);
187 walk_array(arr->data, info->firstType->size, arr->size, info->firstType);
188 afterArray(arr, info);
189 }
190 break;
191 case Type::tTable: {
192 auto tab = (Table *) pa;
193 beforeTable(tab, info);
194 walk_table(tab, info);
195 afterTable(tab, info);
196 }
197 break;
198 case Type::tString: String(*((char **)pa)); break;
199 case Type::tPointer: if ( canVisitPointer(info) ) {
200 if ( info->firstType && info->firstType->type!=Type::tVoid ) {
201 beforePtr(pa, info);
202 walk(*(char**)pa, info->firstType);
203 afterPtr(pa, info);
204 }
205 }
206 break;
207 case Type::tStructure: walk_struct(pa, info->structType); break;
208 case Type::tTuple: walk_tuple(pa, info); break;
209 case Type::tVariant: walk_variant(pa, info); break;
210 case Type::tLambda: {
211 auto ll = (Lambda *) pa;
212 walk ( ll->capture, ll->getTypeInfo() );
213 }
214 break;
215 case Type::tIterator: {
216 auto ll = (Sequence *) pa;
217 if ( ll->iter ) {
218 beforeIterator(ll->iter);
219 ll->iter->walk(*this);
220 }
221 }
222 break;
223 case Type::tHandle:
224 if ( canVisitHandle_(pa, info) ) {
225 beforeHandle_(pa, info);
226 info->getAnnotation()->walk(*this, pa);
227 afterHandle_(pa, info);
228 }

Callers

nothing calls this directly

Calls 15

beforeRefFunction · 0.85
walkFunction · 0.85
afterRefFunction · 0.85
beforeArrayFunction · 0.85
afterArrayFunction · 0.85
beforeTableFunction · 0.85
afterTableFunction · 0.85
StringFunction · 0.85
canVisitPointerFunction · 0.85
beforePtrFunction · 0.85
afterPtrFunction · 0.85
beforeIteratorFunction · 0.85

Tested by

no test coverage detected