diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-02-28 18:37:38 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-02-28 18:37:38 +0000 |
commit | c89c4d4602d76e87391ea124aea8e11f2c3eea21 (patch) | |
tree | 5be5ef8e9cbd5687d895ff9bf82882af47edf35a /util/romcc | |
parent | 9ea7bff22ecaba50eefd817dd74d092120682f1a (diff) | |
download | coreboot-c89c4d4602d76e87391ea124aea8e11f2c3eea21.tar.xz |
Add attribute((noreturn)) to romcc
It doesn't do anything, but it allows the same code to be compiled with gcc and
romcc.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5172 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/romcc')
-rw-r--r-- | util/romcc/romcc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index 2691036c18..b961d66c32 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -1083,6 +1083,7 @@ struct compile_state { struct hash_entry *i_break; struct hash_entry *i_default; struct hash_entry *i_return; + struct hash_entry *i_noreturn; /* Additional hash entries for predefined macros */ struct hash_entry *i_defined; struct hash_entry *i___VA_ARGS__; @@ -12758,6 +12759,9 @@ static unsigned int attrib(struct compile_state *state, unsigned int attributes) } attributes |= ATTRIB_ALWAYS_INLINE; } + else if (ident == state->i_noreturn) { + // attribute((noreturn)) does nothing (yet?) + } else { error(state, 0, "Unknown attribute:%s", ident->name); } @@ -24994,6 +24998,7 @@ static void compile(const char *filename, /* Memorize where some attribute keywords are. */ state.i_noinline = lookup(&state, "noinline", 8); state.i_always_inline = lookup(&state, "always_inline", 13); + state.i_noreturn = lookup(&state, "noreturn", 8); /* Process the command line macros */ process_cmdline_macros(&state); |