lp:coccinelle

Created by Nicolas Palix on 2010-12-14 and last modified on 2020-09-15
Get this branch:
bzr branch lp:coccinelle

Related bugs

Related blueprints

Branch information

Owner:
Nicolas Palix
Project:
Coccinelle
Status:
Development

Import details

Import Status: Reviewed

This branch is an import of the HEAD branch of the Git repository at git://github.com/coccinelle/coccinelle.git.

The next import is scheduled to run in 1 hour.

Last successful import was 4 hours ago.

Import started 4 hours ago on izar and finished 4 hours ago taking 20 seconds — see the log
Import started 10 hours ago on alnitak and finished 10 hours ago taking 20 seconds — see the log
Import started 16 hours ago on izar and finished 16 hours ago taking 20 seconds — see the log
Import started 22 hours ago on alnitak and finished 22 hours ago taking 20 seconds — see the log
Import started on 2020-09-24 on izar and finished on 2020-09-24 taking 15 seconds — see the log
Import started on 2020-09-24 on izar and finished on 2020-09-24 taking 20 seconds — see the log
Import started on 2020-09-24 on izar and finished on 2020-09-24 taking 20 seconds — see the log
Import started on 2020-09-24 on alnitak and finished on 2020-09-24 taking 25 seconds — see the log
Import started on 2020-09-23 on alnitak and finished on 2020-09-23 taking 20 seconds — see the log
Import started on 2020-09-23 on alnitak and finished on 2020-09-23 taking 20 seconds — see the log

Recent revisions

4954. By Jaskaran Singh <email address hidden> on 2020-09-15

parsing_c: type_annoter_c: Use name cache for type annotation

Use the name cache for type annotation. On encountering the following
which are not stored in the environment, the name cache is looked up and
the relevant header file is parsed for type information:
 - struct field use
 - typedef
 - function call
 - identifier
 - enumeration constant

Signed-off-by: Jaskaran Singh <email address hidden>

4953. By Jaskaran Singh <email address hidden> on 2020-09-15

parsing_c: parse_c: Build name cache and includes dependency graph

Build the includes dependency graph and name cache while parsing header
files. Every header file is parsed only once for name caching and, while
parsing these files, an includes dependency graph is built to determine
reachability of one header file from another file.

Signed-off-by: Jaskaran Singh <email address hidden>

4952. By Jaskaran Singh <email address hidden> on 2020-09-15

parsing_c: includes_cache: Implement a name cache

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

The following is a high-level description of what has been implemented:
- As header files are recursively parsed, they are scanned for the
  following:
 - fields of structs/unions/enums
 - typedefs
 - function prototypes
 - global variables
  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.
- A dependency graph is built to determine dependencies between all the
  files in the codebase.
- 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.
- The name cache gives a list of files that the name is declared/defined
  in. These files are cross checked with the dependency graph to
  determine if any of these are reachable by the file that the annoter is
  working on.
- If a reachable header file is found, that file is parsed and all of
  the above listed constructs are extracted from it.

Suggested-by: Julia Lawall <email address hidden>
Signed-off-by: Jaskaran Singh <email address hidden>

4951. By Julia Lawall on 2020-09-15

Merge branch 'tmartine/coccinelle-do_not_set_pythonhome'

4950. By Thierry Martinez <email address hidden> on 2020-09-09

Remove stdcompat__stubs.c from versioning

This file is auto-generated from stdcompat__stubs.c.in

4949. By Julia Lawall on 2020-09-07

omit little drop functions

In the sgrep case the drop functions are not efficient because they
rebuild the affected top-level code fragment multiple times. Some of
the functions are used in one other place. Since we already have
functions for checking for various syntax types and since the function
name exclude is quite understandable, just inline the drop functions and
remove them.

4948. By Julia Lawall on 2020-09-06

recognize Comma as a fake token to be dropped by sgrep

Fake commas are kept around in the unparsing process. Remove them
in the sgrep (*) case with the other fake tokens.

It is not possible to have a proper test case for this issue because *
doesn't change the code. The problem can be seen using the included
test case and the command line argument --save-tmp-files on a version of
spatch from before this commit. Looking at the generated file in /tmp
shows the extra comma. The fake comma on this line causes a - to be
printed in the generated diff.

Reported-by: Markus Elfring <email address hidden>

4947. By Julia Lawall on 2020-09-04

rename test functions apart

4946. By Julia Lawall on 2020-09-03

drop trailing + code when deciding about newline

Follow the same strategy as in commit 3e27e3a55. The new test case
exercises the removed Fake - newline - removed minus example, and
triggers the removal of the newline.

Testing on all examples in the tests directory shows no differences in
the generated code.

4945. By Julia Lawall on 2020-09-03

add newline after unminus of danger ;

When a declaration appears to be fully removed in the semantic patch, it
might not actually be removed, if it declares some extra non-matching
variables. In that case, the declaration is kept and if code was added
to replace the declaration, it will need a newline in front of it,
analogous to the effect of giving the before argument as After to
Unparse_cocci.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers