Skip to contentSkip to conversation

parsing_c: includes_cache: Implement a name cache

RFC PATCH Markus Elfring 2 participants 2 messages Sep 9, 2020 – Sep 10, 2020

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

Implement a name cache and includes dependency graph to optimize performance for recursive parsing of header files.

Can such information trigger any more evolution besides the contributed OCaml source code?

Quoted 2 lines

The names of the above are stored in a "name cache", i.e. a hashtable to map the name to the files it is declared in.

How much does hashing matter here?

Quoted 2 lines

- A dependency graph is built to determine dependencies between all the files in the codebase.

Can such information indicate a need for its own programming interface?

Quoted 3 lines

- In the type annotation phase of the C subsystem, if a function call, struct/union field or identifier is encountered, the type of which is not known to the annoter, the name cache is checked for the name.

Is there anything in common with symbol tables?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#1 lore raw
Quoted 8 lines · Markus Elfring
Quoted 2 lines

Implement a name cache and includes dependency graph to optimize performance for recursive parsing of header files.

Can such information trigger any more evolution besides the contributed
OCaml source code?

Quoted 6 lines
Quoted 3 lines

The names of the above are stored in a "name cache", i.e. a
hashtable
to map the name to the files it is declared in.

How much does hashing matter here?

It's a hash table. I don't know how OCaml's Hashtbl works under the hood.

Quoted 8 lines
Quoted 4 lines

- A dependency graph is built to determine dependencies between all the
files in the codebase.

Can such information indicate a need for its own programming interface?

If you mean graphs, there are entire modules for them in Coccinelle. (commons/ograph_*.ml).

Quoted 9 lines
Quoted 6 lines

- In the type annotation phase of the C subsystem, if a function call,
struct/union field or identifier is encountered, the type of
which is
not known to the annoter, the name cache is checked for the name.

Is there anything in common with symbol tables?

Kind of.

Cheers,
Jaskaran.

Quoted 2 lines

Regards,
Markus

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci