Every entity's declarations by (class, path). */
| 2294 | |
| 2295 | /* Every entity's declarations by (class, path). */ |
| 2296 | static bool build_binds(cs_index_t *ix) { |
| 2297 | for (int i = 0; i < ix->nents; i++) { |
| 2298 | cs_entity_t *e = &ix->ents[i]; |
| 2299 | e->binds = (cs_bind_t *)ix_alloc(ix, (size_t)e->ndecls * sizeof(cs_bind_t)); |
| 2300 | if (!e->binds) { |
| 2301 | return false; |
| 2302 | } |
| 2303 | for (int d = 0; d < e->ndecls; d++) { |
| 2304 | const cs_file_t *f = &ix->files[e->decls[d].file]; |
| 2305 | e->binds[d] = |
| 2306 | (cs_bind_t){.file = e->decls[d].file, |
| 2307 | .type = e->decls[d].type, |
| 2308 | .cls = decl_class(f, f->types[e->decls[d].type].node != NULL)}; |
| 2309 | } |
| 2310 | if (e->ndecls > 1) { |
| 2311 | qsort(e->binds, (size_t)e->ndecls, sizeof(cs_bind_t), bind_cmp); |
| 2312 | } |
| 2313 | } |
| 2314 | return true; |
| 2315 | } |
| 2316 | |
| 2317 | /* ── Members by entity and name ──────────────────────────────────── */ |
| 2318 |
no test coverage detected