From 53fa60816196380c1a9e7d3e13d2d9bee4bee794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Thu, 6 Apr 2017 20:35:46 +0100 Subject: [PATCH] Deprecate IMPORT keyword MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IMPORT is simply useless, any symbol that isn't found in the current file is automatically flagged as imported symbol. Signed-off-by: Antonio Niño Díaz --- include/asm/symbol.h | 1 - src/asm/asmy.y | 8 +++++++- src/asm/symbol.c | 18 ------------------ 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/include/asm/symbol.h b/include/asm/symbol.h index d0fc764d..5c2ee729 100644 --- a/include/asm/symbol.h +++ b/include/asm/symbol.h @@ -54,7 +54,6 @@ void sym_AddEqu(char *tzSym, SLONG value); void sym_AddSet(char *tzSym, SLONG value); void sym_Init(void); ULONG sym_GetConstantValue(char *s); -void sym_Import(char *tzSym); ULONG sym_isConstant(char *s); struct sSymbol *sym_FindSymbol(char *tzName); void sym_Global(char *tzSym); diff --git a/src/asm/asmy.y b/src/asm/asmy.y index 1a39812b..63dfa3b0 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -772,7 +772,13 @@ import_list : import_list_entry | import_list_entry ',' import_list ; -import_list_entry : T_ID { sym_Import($1); } +import_list_entry : T_ID { + /* This is done automatically if + * the label isn't found in the + * list of defined symbols. */ + if( nPass==1 ) + warning("IMPORT is a deprecated keyword with no effect: %s", $1); + } ; export : T_POP_EXPORT export_list diff --git a/src/asm/symbol.c b/src/asm/symbol.c index e4632982..f8ad1f6b 100644 --- a/src/asm/symbol.c +++ b/src/asm/symbol.c @@ -689,24 +689,6 @@ sym_Export(char *tzSym) } -/* - * Import a symbol - */ -void -sym_Import(char *tzSym) -{ - if (nPass == 1) { - /* only import symbols in pass 1 */ - struct sSymbol *nsym; - - if (findsymbol(tzSym, NULL)) { - yyerror("'%s' already defined", tzSym); - } - if ((nsym = createsymbol(tzSym)) != NULL) - nsym->nType |= SYMF_IMPORT; - } -} - /* * Globalize a symbol (export if defined, import if not) */