diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-01 07:21:32 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-02-17 18:38:50 +0100 |
| commit | f45b7c7caeb21d9d6baec8a4b9ef1b9821efaa95 (patch) | |
| tree | 0733cb084a9c7bc49b2375d393b214eb105850d5 | |
| parent | 6794d824a8d69981cdfa2ffb97debd8ec50e090c (diff) | |
| download | sparse-dev-f45b7c7caeb21d9d6baec8a4b9ef1b9821efaa95.tar.gz | |
builtin: add ctype for const {void,char} *
These types are needed to declare builtin functions without
passing by the add_pre_buffer()-tokenization-parsing phases.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | symbol.c | 7 | ||||
| -rw-r--r-- | symbol.h | 2 |
2 files changed, 9 insertions, 0 deletions
@@ -696,6 +696,8 @@ struct symbol bool_ctype, void_ctype, type_ctype, string_ctype, ptr_ctype, lazy_ptr_ctype, incomplete_ctype, label_ctype, bad_ctype, null_ctype; +struct symbol const_void_ctype, const_char_ctype; +struct symbol const_ptr_ctype, const_string_ctype; struct symbol zero_int; @@ -762,6 +764,11 @@ static const struct ctype_declare { { &null_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, { &label_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, { &lazy_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, + + { &const_void_ctype, SYM_NODE, MOD_CONST, NULL, NULL, &void_ctype }, + { &const_char_ctype, SYM_NODE, MOD_CONST, &bits_in_char, &max_int_alignment, &char_ctype }, + { &const_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &const_void_ctype }, + { &const_string_ctype,SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &const_char_ctype }, { NULL, } }; #undef MOD_LLL @@ -267,6 +267,8 @@ extern struct symbol bool_ctype, void_ctype, type_ctype, string_ctype, ptr_ctype, lazy_ptr_ctype, incomplete_ctype, label_ctype, bad_ctype, null_ctype; +extern struct symbol const_void_ctype, const_char_ctype; +extern struct symbol const_ptr_ctype, const_string_ctype; /* Special internal symbols */ extern struct symbol zero_int; |
