summaryrefslogtreecommitdiff
path: root/gcc/cppexp.c
diff options
context:
space:
mode:
authorbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-15 11:09:16 +0000
committerbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-15 11:09:16 +0000
commit69bcbfc6334f2ec547116352fd09d69f83a39880 (patch)
tree8508da5ca527221e1e8d149486ecce4965c7bc0e /gcc/cppexp.c
parent7e6b5a2a2e556581c915c8bf72323e88b8086193 (diff)
downloadgcc-69bcbfc6334f2ec547116352fd09d69f83a39880.tar.gz
1998-12-15 Zack Weinberg <zack@rabi.phys.columbia.edu>
* cpphash.h (union hash_value): Remove `keydef' member, add a `struct hashnode *aschain' member for #assert. * cpplib.c (struct tokenlist_list, struct assertion_hashnode): Delete structure definitions. (assertion_install, assertion_lookup, delete_assertion, check_assertion, compare_token_lists, reverse_token_list, read_token_list, free_token_list): Delete functions. (parse_assertion): New function. (cpp_cleanup): Don't destroy the assertion_hashtable. (do_assert): Gut and rewrite. #assert foo (bar) places entries for `#foo' and `#foo(bar)' in the macro hash table, type T_ASSERT. The value union's `aschain' member is used to chain all answers for a given predicate together. (do_unassert): Also rewritten. Take an un-asserted answer off the chain from its predicate and call delete_macro on the hashnode, or walk a predicate chain calling delete_macro on all the entries. (cpp_read_check_assertion): Simply call parse_assertion to get the canonical assertion name, and look that up in the hash table. * cpplib.h (ASSERTION_HASHNODE,ASSERTION_HASHSIZE,assertion_hashtab): Removed. * cpphash.c (install): Use bcopy instead of an explicit loop to copy the macro name. * cppexp.c (cpp_lex): Convert the result of cpp_read_check_assertion to a `struct operation' directly; don't go through parse_number. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r--gcc/cppexp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 87b84a624fc..f8da2223a6c 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -274,8 +274,11 @@ cpp_lex (pfile, skip_evaluation)
cpp_skip_hspace (pfile);
c = CPP_BUF_PEEK (CPP_BUFFER (pfile));
if (c == '#')
- return parse_number (pfile,
- cpp_read_check_assertion (pfile) ? "1" : "0", 1);
+ {
+ op.op = INT;
+ op.value = cpp_read_check_assertion (pfile);
+ return op;
+ }
if (c == '\n')
{