Skip to content

Commit

Permalink
libsepol/cil: Create functions to write the CIL AST
Browse files Browse the repository at this point in the history
The function cil_print_tree() has existed in cil_tree.c since the
beginning of the development of CIL and secilc. Unfortunately, it
used cil_log() at log level CIL_INFO to print out the AST and
has suffered greatly from bit rot.

Move the functions to write the CIL AST to cil_write_ast.c, update
the functions, and write the AST to the FILE pointer passed in as
an argument.

The function cil_write_ast() supports writing the CIL AST at three
different phases of the compiling a CIL policy. After parsing has
been done and the parse tree has been created, after the CIL AST
has been built, and after the CIL AST has been resolved.

Signed-off-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
jwcart2 authored and fishilico committed Apr 21, 2021
1 parent 6cfebe7 commit 0b31424
Show file tree
Hide file tree
Showing 4 changed files with 1,619 additions and 1,473 deletions.

0 comments on commit 0b31424

Please sign in to comment.