Commit graph

24 commits

Author SHA1 Message Date
Peter Johnson
94ab1135a3 Remove $Id$ and RCSID() usage.
These are useless now that we're using git.
2011-08-19 10:43:16 -07:00
Peter Johnson
77a535f673 Create new working branch for new (Robertson 1977) optimizer.
This doesn't really work yet, which is why it's on a branch!

svn path=/branches/new-optimizer/; revision=1269
2005-10-08 05:45:29 +00:00
Peter Johnson
2d0119c5b7 First part of list file support. This should accurately output all file
bytes and offsets, but relocations are not yet indicated.  Also, this
outputs post-preprocessed source, so no comments, etc, are visible in the
list file.

* listfmt.h: New header file describing listfmt module interface.
* coretype.h: Declare new yasm_listfmt typedef.
* libyasm.h: Include listfmt.h.
* libyasm/Makefile.inc (modinclude_HEADERS): Add listfmt.h.

* yasm-module.h (module_type): Add MODULE_LISTFMT for listfmts.
(load_listfmt_module, list_listfmts): New macros for listfmts.
* yasm-module.c (module_type_str): Add listfmt string for MODULE_LISTFMT.
(list_module_load): Add support for MODULE_LISTFMT.

* bytecode.h (yasm_bc_tobytes): Comment clarification on effect of calling
yasm_bc_tobytes twice on the same bytecode.

* linemgr.h: Replace support for associated data with support for bytecode
and source line information.
(yasm_linemap_get_data): Remove.
(yasm_linemap_get_source): Add.
(yasm_linemap_add_data): Remove.
(yasm_linemap_add_source): Add.
* linemgr.c (yasm_linemap, yasm_linemap_create, yasm_linemap_destroy)
(yasm_linemap_add_data, yasm_linemap_add_source, yasm_linemap_get_data)
(yasm_linemap_get_source): Likewise.

* nasm-token.re (fill): Save previous 2 lines instead of previous 1 line.
(destroy_line, print_line, line_assoc_data): Remove.
(save_line): Save line in structure instead of calling yasm_linemap_add_data.
* nasm-bison.y (input rule): Call yasm_linemap_add_source here.
* nasm-parser.h (yasm_parser_nasm): Add second line of storage and save_last
variable to toggle between the two lines.
* nasm-parser.c (nasm_parser_do_parse): Initialize save_last.

* modules/Makefile.inc: Include new modules/listfmts/Makefile.inc.
* modules/listfmts/Makefile.inc: New;
includes modules/listfmts/nasm/Makefile.inc.
* modules/listfmts/nasm/Makefile.inc: New build file for NASM-like listfmt.
* nasm-listfmt.c: New NASM-like listfmt.

* yasm.c: Enable use of listfmts, and default to NASM listfmt.
(list_filename, cur_listfmt, cur_listfmt_module): New listfmt variables.
(opt_listfmt_handler, opt_listfile_handler): New listfmt functions.
(options): Add --lformat (-L) and --list (-l) options.
(main): Load "nasm" listfmt as default if none selected.
Enable saving of input lines if list output file enabled.
Open and write to the list file.
(open_obj): Rename to open_file and make more generic.
(cleanup): Destroy listfmt and list filename if created.

svn path=/trunk/yasm/; revision=1152
2004-10-02 06:18:30 +00:00
Peter Johnson
1a86c34026 * On most files: re-enable $IdPath$ as $Id$, and enable Id keyword expansion.
svn path=/trunk/yasm/; revision=1137
2004-09-04 01:24:57 +00:00
Peter Johnson
823fb1b781 Reformat multi-file lists to use many += lines instead of using \
(line-continued) lines.  Format-only change, no functional change.

svn path=/trunk/yasm/; revision=959
2003-05-31 22:23:08 +00:00
Peter Johnson
f9e36309e0 Install modules into pkglibdir rather than libdir, and rename to type_keyword
from yasm_keyword (separating same-keyword modules of different types).  Update
yasm frontend module loader to handle this.

svn path=/trunk/yasm/; revision=921
2003-05-03 06:26:15 +00:00
Peter Johnson
c4fe05c29f Rename yasm-module to yasm_module for better libtool compatibility (part of
tracking down an installation bug).

svn path=/trunk/yasm/; revision=907
2003-04-01 05:24:32 +00:00
Peter Johnson
8a48a41ac6 Safe to use -no-undefined on all the modules.
svn path=/trunk/yasm/; revision=850
2003-03-15 07:15:05 +00:00
Peter Johnson
6e9b9c805c Minor cleanups (no functional changes) after src split.
svn path=/trunk/yasm/; revision=848
2003-03-14 04:40:04 +00:00
Peter Johnson
8b564fbaa4 Split src into frontends, libyasm, and modules (forced commit after repo-copy).
svn path=/trunk/yasm/; revision=847
2003-03-13 06:55:46 +00:00
Peter Johnson
d9f68d6d4b Unmodularize errwarn, while making key errwarn functions replaceable.
Also removes dependency of libyasm on libintl (gettext), so it can be linked
-no-undefined now!

svn path=/trunk/yasm/; revision=842
2003-03-10 08:55:41 +00:00
Peter Johnson
854ea00a2b Move yasm_std_errwarn and yasm_std_linemgr into libyasm.
svn path=/trunk/yasm/; revision=840
2003-03-08 19:55:56 +00:00
Peter Johnson
288401feff Refactor list_objfmts() and list_parsers() into module.c.
svn path=/trunk/yasm/; revision=839
2003-03-08 19:29:23 +00:00
Peter Johnson
49623d5589 Add the "real" NASM preprocessor, and default to it. As NASM is LGPL, no
licensing issues with this.  All the compiler warnings have been fixed, and
most namespace issues resolved.  However, the integration isn't perfect, and
there are probably memory leaks.  Note that right now the real NASM preproc
and "compatible" NASM parser share a module.  The parser should probably be
renamed to avoid extra loading and code source confusion.

svn path=/trunk/yasm/; revision=800
2002-11-04 08:35:35 +00:00
Peter Johnson
9f6cb6783f Modularize errwarn. gettext()-ize in errwarn, not in every module, eliminating
libintl dependency in modules.
Also standardize initialize() and cleanup() functions.
Move replace_extension() from file.c to main.c.
Clean up some extern variable declarations in various places (particularly
nasm-compatible parser).

svn path=/trunk/yasm/; revision=792
2002-11-01 10:05:03 +00:00
Peter Johnson
2f19ce4ecd Delete last of global variables by making a line manager and passing around
the line index.  Fixes some minor line number/error message nits due to
incorrect usage of line_index in old global variable method.

svn path=/trunk/yasm/; revision=787
2002-10-27 09:21:39 +00:00
Peter Johnson
d6f22c3fce Dynamically load all modules (preloading some of the default ones).
Start reducing global variables for cleaner module separation.
Add rudimentary debug format module interface and "null" debug format.

svn path=/trunk/yasm/; revision=784
2002-10-26 08:25:39 +00:00
Peter Johnson
cefe5613c8 Include src/compat-queue.h as an EXTRA_yasm_SOURCES instead of just EXTRA_DIST.
svn path=/trunk/yasm/; revision=740
2002-10-05 06:24:50 +00:00
Peter Johnson
b7a8747102 Move yasm core files into a libyasm shared library (avoiding backlinking).
Some cleanups still needed; a few things in globals should really be somewhere
else, or named differently.

svn path=/trunk/yasm/; revision=705
2002-09-23 06:16:59 +00:00
Peter Johnson
aa6f573370 Update DISTFILES to reflect src/lclint.sh -> splint.sh move.
svn path=/trunk/yasm/; revision=550
2002-03-28 05:23:00 +00:00
Peter Johnson
5d2e9ea0f0 Allow preprocess-only and setting of preproc. Update main() and related
functions to be a bit more clean.

svn path=/trunk/yasm/; revision=479
2002-03-06 06:02:21 +00:00
Peter Johnson
73e3e69375 Add tests/Makefile.inc to EXTRA_DIST.
svn path=/trunk/yasm/; revision=415
2001-12-28 05:50:20 +00:00
Peter Johnson
f5358bb32e Change EXTRA_DIST to reflect movement of strsep.c and mergesort.c.
svn path=/trunk/yasm/; revision=411
2001-12-27 04:06:05 +00:00
Peter Johnson
0caf84d85f Massive build system change: single Makefile instead of recursive.
Note: still is automake-generated, but uses .inc files in the various
subdirectories instead of .am files.
TODO: Move arch-specific components of bytecode_test and memexpr_test to
arch/x86.

svn path=/trunk/yasm/; revision=394
2001-12-26 07:14:05 +00:00