Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 Handle function symbol renames.
details: https://anonhg.NetBSD.org/src/rev/0b8e34f06010
branches: trunk
changeset: 342636:0b8e34f06010
user: christos <christos%NetBSD.org@localhost>
date: Sat Jan 02 17:44:33 2016 +0000
description:
Handle function symbol renames.
diffstat:
usr.bin/xlint/lint1/cgram.y | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diffs (91 lines):
diff -r e8209d3ea83f -r 0b8e34f06010 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sat Jan 02 17:44:21 2016 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sat Jan 02 17:44:33 2016 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.74 2015/10/13 20:49:39 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.75 2016/01/02 17:44:33 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.74 2015/10/13 20:49:39 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.75 2016/01/02 17:44:33 christos Exp $");
#endif
#include <stdlib.h>
@@ -68,6 +68,8 @@
static int toicon(tnode_t *, int);
static void idecl(sym_t *, int, sbuf_t *);
static void ignuptorp(void);
+static sym_t *symbolrename(sym_t *, sbuf_t *);
+
#ifdef DEBUG
static inline void CLRWFLGS(const char *file, size_t line);
@@ -955,7 +957,7 @@
$$ = addarray($1, 1, toicon($3, 0));
}
| notype_direct_decl param_list opt_asm_or_symbolrename {
- $$ = addfunc($1, $2);
+ $$ = addfunc(symbolrename($1, $3), $2);
popdecl();
blklev--;
}
@@ -988,7 +990,7 @@
$$ = addarray($1, 1, toicon($3, 0));
}
| type_direct_decl param_list opt_asm_or_symbolrename {
- $$ = addfunc($1, $2);
+ $$ = addfunc(symbolrename($1, $3), $2);
popdecl();
blklev--;
}
@@ -1025,7 +1027,7 @@
$$ = addarray($1, 1, toicon($3, 0));
}
| direct_param_decl param_list opt_asm_or_symbolrename {
- $$ = addfunc($1, $2);
+ $$ = addfunc(symbolrename($1, $3), $2);
popdecl();
blklev--;
}
@@ -1054,7 +1056,7 @@
$$ = addarray($1, 1, toicon($3, 0));
}
| direct_notype_param_decl param_list opt_asm_or_symbolrename {
- $$ = addfunc($1, $2);
+ $$ = addfunc(symbolrename($1, $3), $2);
popdecl();
blklev--;
}
@@ -1350,12 +1352,12 @@
$$ = addarray($1, 1, toicon($3, 0));
}
| abs_decl_param_list opt_asm_or_symbolrename {
- $$ = addfunc(aname(), $1);
+ $$ = addfunc(symbolrename(aname(), $2), $1);
popdecl();
blklev--;
}
| direct_abs_decl abs_decl_param_list opt_asm_or_symbolrename {
- $$ = addfunc($1, $2);
+ $$ = addfunc(symbolrename($1, $3), $2);
popdecl();
blklev--;
}
@@ -2048,3 +2050,11 @@
yyclearin;
}
+
+static sym_t *
+symbolrename(sym_t *s, sbuf_t *sb)
+{
+ if (sb)
+ s->s_rename = sb->sb_name;
+ return s;
+}
Home |
Main Index |
Thread Index |
Old Index