Peter Johnson
2727869bd8
Start work on optimizer module. Moved all "post-parser-finalization" code
...
into the optimizer stage, where it belongs. Naming has changed, but most
implementations have not been brought up to date to do what they say they
do.
svn path=/trunk/yasm/; revision=388
23 years ago
Peter Johnson
0f852333df
LCLint-related comment fixes.
...
svn path=/trunk/yasm/; revision=387
23 years ago
Peter Johnson
ae85d1edb1
Add support for incbin pseudo-instruction.
...
svn path=/trunk/yasm/; revision=386
23 years ago
Peter Johnson
b3cb8c0292
Move assert.h include to util.h
...
In util.h, define NDEBUG if not running lint.
svn path=/trunk/yasm/; revision=385
23 years ago
Peter Johnson
e8d7d5cad9
Add opt_flags (space for use by the optimizer).
...
svn path=/trunk/yasm/; revision=384
23 years ago
Peter Johnson
69c42d7aaa
Plug memory leak in floatnum_new().
...
svn path=/trunk/yasm/; revision=383
23 years ago
Peter Johnson
f36a664a49
strcmp() returns 0 if the strings are equal.
...
svn path=/trunk/yasm/; revision=382
23 years ago
Peter Johnson
6bbcad2e6c
Make extension-replacement a utility function in file.c (as it will need to
...
be performed for the list file, etc, as well as the object file).
svn path=/trunk/yasm/; revision=381
23 years ago
Peter Johnson
7b4e6c09dc
Add support for NASM's %line.
...
svn path=/trunk/yasm/; revision=376
23 years ago
Peter Johnson
a64ee74f8f
Fix typo in HAVE_STRCMPI strncasecmp() #define.
...
svn path=/trunk/yasm/; revision=373
23 years ago
Peter Johnson
3b496cdde7
Do intl more correctly. nointl/libintl.h is unnecessary; it can be detected
...
in util.h by the ENABLE_NLS define. Fix Mkfiles to reflect. Actually enable
if available in main().
svn path=/trunk/yasm/; revision=372
23 years ago
Peter Johnson
4bcb83da56
(Mostly) Clean up floatnum internal allocations.
...
svn path=/trunk/yasm/; revision=370
23 years ago
Peter Johnson
4af9db689c
Change dbg optimizer to basic.
...
svn path=/trunk/yasm/; revision=365
23 years ago
Peter Johnson
a7ce9bf2d1
Delete dbg optimizer (won't be useful) and add "basic" (equiv. to NASM 2-pass)
...
optimizer.
svn path=/trunk/yasm/; revision=364
23 years ago
Peter Johnson
ce4a5fe02a
Switch from using ternary tree to Hash Array Mapped Trie (HAMT), which has
...
*much* less overhead.
XXX: current implementation of HAMT is *not* portable due to pointer alignment
restrictions (it uses the LSB of a pointer to store a flag). Need to write a
portable (if not so space-efficient) equivalent.
svn path=/trunk/yasm/; revision=363
23 years ago
Peter Johnson
825eaa5823
Massive cleanup of debugging output (via _print() functions). All now take
...
FILE *'s to print to somewhere other than stdout, and the formatting is
improved through the use of a global indent_level.
Changes to main() include the ability to specify an output file.
svn path=/trunk/yasm/; revision=357
23 years ago
Peter Johnson
b930d117d3
Polish up most directive support. This necessitated adding objfmt-specific
...
data pointers to symrec for extern/common/etc. Also fixed parsing of direxpr;
it didn't allow exprs with ID's before.
svn path=/trunk/yasm/; revision=356
23 years ago
Peter Johnson
ac655d6bc6
Add vps_next().
...
svn path=/trunk/yasm/; revision=355
23 years ago
Peter Johnson
b2876e5f3a
Allow multiple EXTERN's of same variable without error (NASM's behavior).
...
svn path=/trunk/yasm/; revision=354
23 years ago
Peter Johnson
7a3761ac0c
Plug memory leak in dvs_delete().
...
svn path=/trunk/yasm/; revision=352
23 years ago
Peter Johnson
379d2b353c
Print "undefined symbol" message for all undefined symbols. Also make a little
...
nicer output by only outputting the "reported only once" informational message
once, for the first (line-wise) error.
Note: this isn't foolproof, as different files have different line countings...
need a monotonically increasing "line" counter to fix this. This is a problem
in more areas than just here, though.
svn path=/trunk/yasm/; revision=351
23 years ago
Peter Johnson
b1257a7992
Bugfix in expr_copy_except(): could allocate less than 2 terms of space (eg,
...
actually smaller than the structure).
svn path=/trunk/yasm/; revision=350
23 years ago
Peter Johnson
7bdebece8b
Don't print out *all* bytecodes in the label's section for every label!
...
svn path=/trunk/yasm/; revision=349
23 years ago
Peter Johnson
9a84b66d1c
Don't try to redefine a label for an already existing segment. Thus, add a
...
return flag from sections_switch_general() to indicate if the segment is new,
which is checked in objfmt_sections_switch().
svn path=/trunk/yasm/; revision=345
23 years ago
Peter Johnson
8cbf2c2312
- Greatly enhance capabilities of directives (they're actually parsed now).
...
objfmt interface changed a lot due to this.
- New variables cur_objfmt and cur_parser that define what objfmt/parser are
active. They're set in main() by searching through the list of objfmts and
parsers. This necessitated libyasm.a to be listed twice in LDADD.
svn path=/trunk/yasm/; revision=343
23 years ago
Peter Johnson
b963c38833
Change val to be a string instead of an expr.
...
svn path=/trunk/yasm/; revision=342
23 years ago
Peter Johnson
5cd0858637
Add valparam data structure.
...
svn path=/trunk/yasm/; revision=340
23 years ago
Peter Johnson
29f7d9a917
New function: expr_get_symrec().
...
svn path=/trunk/yasm/; revision=338
23 years ago
Peter Johnson
d6d0cb8785
Add symrec_delete() for deleting non-table symbols. Use it from expr_delete().
...
Also allow the sect for labels to be NULL (special case for new directive
handling code).
svn path=/trunk/yasm/; revision=337
23 years ago
Peter Johnson
8178f883a5
Modify so that almost everything passes LCLint with the options in lclint.sh.
...
This is actually worthwhile; I found and fixed a few bugs/edge cases while
doing this.
For more information on LCLint, see <http://lclint.cs.virginia.edu/ >.
svn path=/trunk/yasm/; revision=335
23 years ago
Peter Johnson
fc603c2900
Add RCSID().
...
svn path=/trunk/yasm/; revision=334
23 years ago
Peter Johnson
424c30fdaa
Allow symrec_foreach return value to be ignored (in lclint).
...
svn path=/trunk/yasm/; revision=332
23 years ago
Peter Johnson
4df0191de8
lclint-ize gettext().
...
svn path=/trunk/yasm/; revision=331
23 years ago
Peter Johnson
9f97bcd9d0
Fix some nits found by lclint. Still something weird going on with list2 in
...
mergesort(), according to lclint, but I haven't figured out if it's real or
not.
svn path=/trunk/yasm/; revision=330
23 years ago
Peter Johnson
21eb7c7fe2
Add some lclint annotations.
...
svn path=/trunk/yasm/; revision=329
23 years ago
Peter Johnson
d7fe402fb9
Split away x86-specific parts of expression handling (eg, effective address ->
...
ModRM+SIB).
svn path=/trunk/yasm/; revision=328
23 years ago
Peter Johnson
f58d7cb093
Split x86-specific stuff away from bytecode.
...
svn path=/trunk/yasm/; revision=316
23 years ago
Peter Johnson
c9d92847b6
Start framework for separating architecture-dependent functions and data
...
structures from the rest of the assembler. We're not trying to write GAS
here (yet :), but doing this will make large parts of the codebase a lot
clearer.
svn path=/trunk/yasm/; revision=314
23 years ago
Peter Johnson
a7ac50c918
Add coretype.h, make util.h do a lot more, use util.h to simplify include
...
sections of C files. Also remove IdPath from top comment in files where
RCSID() is used. Move RCSID() to immediately after util.h include.
svn path=/trunk/yasm/; revision=313
23 years ago
Peter Johnson
405df52913
bytecode_print(): Change how NULL values are output for imm and multiple.
...
bytecode_parser_finalize_insn(): Add some preliminary imm handling. Handle
shift_op special-casing (,1 hack).
svn path=/trunk/yasm/; revision=312
23 years ago
Peter Johnson
665eddf5d7
Conditional x* prototypes on !DMALLOC (as they're defined by dmalloc.h if
...
DMALLOC is enabled).
svn path=/trunk/yasm/; revision=311
23 years ago
Peter Johnson
79e945c33c
Optimize expression building a bit in expr_new() by eliminating IDENT's here.
...
This saves a lot of extra unnecessary recursions when the expr gets to the
simplification stage.
svn path=/trunk/yasm/; revision=310
23 years ago
Peter Johnson
ad7cbcea04
Add memory expressions tests (checkea).
...
Split off errwarn functions so that they can be overridden in test cases.
svn path=/trunk/yasm/; revision=309
23 years ago
Peter Johnson
00788fa80c
Fix errors found in expr_level_op() and checkea_calc_displen() by new test
...
cases.
svn path=/trunk/yasm/; revision=308
23 years ago
Peter Johnson
94730125be
Missed a free->xfree conversion.
...
svn path=/trunk/yasm/; revision=306
23 years ago
Peter Johnson
10fa8fadc1
Correctly process 32-bit memory expressions in expr_checkea().
...
svn path=/trunk/yasm/; revision=303
23 years ago
Peter Johnson
305b471f51
On xfree(NULL), just return instead of triggering InternalError().
...
svn path=/trunk/yasm/; revision=302
23 years ago
Peter Johnson
4d95de5161
Plug memory leaks, and enhance finding later ones with *_delete functions.
...
Fix a *major* bug in expr_level_op().
svn path=/trunk/yasm/; revision=301
23 years ago
Peter Johnson
dc1c3c70f5
Get rid of all the extra filename strdup()'s. (Bug #14 ).
...
svn path=/trunk/yasm/; revision=300
23 years ago
Peter Johnson
7a6eaf8c03
Make InternalError() a bit easier to call. Also, reverse its file and line
...
parameters to match the *At() functions.
svn path=/trunk/yasm/; revision=299
23 years ago