Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PIRC: Really use headerizer

git-svn-id: https://svn.parrot.org/parrot/trunk@44004 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 76df6b797ce0d01610b5313c9a694a652ab6d090 1 parent 6f165d1
@bacek bacek authored
Showing with 18 additions and 15 deletions.
  1. +7 −7 src/pircompunit.c
  2. +11 −8 src/pircompunit.h
View
14 src/pircompunit.c
@@ -901,7 +901,7 @@ element of the list) is updated, and returned.
PARROT_IGNORABLE_RESULT
PARROT_CANNOT_RETURN_NULL
argument *
-add_arg(argument *last, argument * const newarg)
+add_arg(ARGMOD(argument *last), argument * const newarg)
{
PARROT_ASSERT(last);
PARROT_ASSERT(newarg);
@@ -2193,7 +2193,7 @@ Add an operand at the end of the list of operands of the current instruction.
*/
void
-push_operand(ARGIN(lexer_state * const lexer), NOTNULL(expression * const operand))
+push_operand(ARGIN(lexer_state * const lexer), ARGIN(expression * const operand))
{
PARROT_ASSERT(CURRENT_INSTRUCTION(lexer));
@@ -2236,7 +2236,7 @@ The returned expression node has type EXPR_KEY.
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
expression *
-expr_from_key(ARGIN(lexer_state * const lexer), NOTNULL(key * const k))
+expr_from_key(ARGIN(lexer_state * const lexer), ARGIN(key * const k))
{
expression *e = new_expr(lexer, EXPR_KEY);
e->expr.k = k;
@@ -2278,7 +2278,7 @@ Wraps the expression C<expr> in a key node and returns that.
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
key *
-new_key(ARGIN(lexer_state * const lexer), NOTNULL(expression * const expr))
+new_key(ARGIN(lexer_state * const lexer), ARGIN(expression * const expr))
{
key *k = pir_mem_allocate_zeroed_typed(lexer, key);
k->head = new_key_entry(lexer, expr);
@@ -2301,8 +2301,8 @@ pointed to by C<keylist>. C<keylist> is returned.
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
key *
-add_key(ARGIN(lexer_state * const lexer), NOTNULL(key * const keylist),
- NOTNULL(expression * const exprkey))
+add_key(ARGIN(lexer_state * const lexer), ARGIN(key * const keylist),
+ ARGIN(expression * const exprkey))
{
key_entry *newkey = new_key_entry(lexer, exprkey);
key_entry *iter = keylist->head;
@@ -2444,7 +2444,7 @@ The C<opinfo>, C<opname> and C<opcode> fields of C<instr> are updated.
*/
void
-update_op(ARGIN(lexer_state * const lexer), NOTNULL(instruction * const instr), int newop)
+update_op(ARGIN(lexer_state * const lexer), ARGIN(instruction * const instr), int newop)
{
/* Deduct number of ints needed for the old instruction, if there is one.
* This is necessary during strength reduction and other optimizations, once
View
19 src/pircompunit.h
@@ -399,14 +399,16 @@ struct lexer_state;
PARROT_IGNORABLE_RESULT
PARROT_CANNOT_RETURN_NULL
-argument * add_arg(argument *last, argument * const newarg);
+argument * add_arg(ARGMOD(argument *last), argument * const newarg)
+ __attribute__nonnull__(1)
+ FUNC_MODIFIES(*last);
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
key * add_key(
ARGIN(lexer_state * const lexer),
- NOTNULL(key * const keylist),
- NOTNULL(expression * const exprkey))
+ ARGIN(key * const keylist),
+ ARGIN(expression * const exprkey))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3);
@@ -469,7 +471,7 @@ PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
expression * expr_from_key(
ARGIN(lexer_state * const lexer),
- NOTNULL(key * const k))
+ ARGIN(key * const k))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -543,7 +545,7 @@ PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
key * new_key(
ARGIN(lexer_state * const lexer),
- NOTNULL(expression * const expr))
+ ARGIN(expression * const expr))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -587,7 +589,7 @@ target * new_target(ARGIN(lexer_state * const lexer))
void push_operand(
ARGIN(lexer_state * const lexer),
- NOTNULL(expression * const operand))
+ ARGIN(expression * const operand))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -756,7 +758,7 @@ void update_instr(
void update_op(
ARGIN(lexer_state * const lexer),
- NOTNULL(instruction * const instr),
+ ARGIN(instruction * const instr),
int newop)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -766,7 +768,8 @@ void update_sub_register_usage(
unsigned reg_usage[NUM_PARROT_TYPES])
__attribute__nonnull__(1);
-#define ASSERT_ARGS_add_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_add_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(last))
#define ASSERT_ARGS_add_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(lexer) \
, PARROT_ASSERT_ARG(keylist) \
Please sign in to comment.
Something went wrong with that request. Please try again.