Releases: google/emboss
Releases · google/emboss
v2024.1205.195338
Fix tests under `bazel test -c opt`. (#212) With certain versions of GCC, `bazel test -c opt ...` failed, apparently due to a compiler bug. This change: 1. Adds a workaround for the GCC bug. 2. Enables the workaround on versions of GCC known to have the bug. 3. Documents the bug (in comments). 4. Enables testing with `-c opt` as part of the commit hook. Note that the versions covered by #2 are a little wider than may be technically necessary. As of the time of writing, this affects all released versions of GCC from 12.1 through 14.1, but the GCC fix has been backported to the 12.X and 13.X branches. It may be possible to reduce the workaround's scope once those are released.
v2024.1120.233102
Add test profiles that disable all `EMBOSS_CHECK`s. (#211) This catches cases where C++ code inadvertently includes side effects inside of an `EMBOSS_CHECK`; the default `EMBOSS_CHECK` uses `assert`, which will be omitted when `NDEBUG` is defined.
v2024.1017.203246
Convert Location to a namedtuple, and associated cleanup (#205) This change makes the `Location` dataclass, which does not change frequently, into a new `SourceLocation` namedtuple, and changes the `SourceLocation` serialization. As a result, with this change: * `embossc` runs about 25% faster on a large (7kLOC) input; `python3 -OO emboss` runs about 19% faster on the same input. * Serialized IR is about 45% smaller. Details: * Replace the `ir_data.Location` dataclass with a new `parser_types.SourceLocation` namedtuple. The rename helps clarify the difference between a location within source code (`SourceLocation`) and a location within a structure (`FieldLocation`). * Similarly, replace `ir_data.Position` with `parser_types.SourcePosition`. * Update any place that edits a `SourceLocation` with an appropriate assignment; e.g., `x.source_location.end = y` becomes `x.source_location = x.source_location._replace(end=y)`. In most cases, several fields were updated consecutively; those updates are been merged. * Update the JSON serialization to use the compact format. * Replace `format_location()` and `format_position()` with `__str__()` methods on `SourceLocation` and `SourcePosition`, respectively. * Replace `parse_location()` and `parse_position()` with `from_str()` class methods on `SourceLocation` and `SourcePosition`, respectively. * Move the `make_location()` functionality into `SourceLocation.__new__()`. * Update `_to_dict` and `_from_dict` in `IrDataSerializer` to stringify and destringify `SourceLocation`. It is tempting to try to do this during the JSON serialization step (with a `default=` parameter to `json.dumps` and an `object_hook=` parameter to `json.loads`), but it is tricky to get the `object_hook` to know when to convert.
v2024.1011.225822
Emit a warning when the cached parser is not used. (#204) This change checks to see if the cached parser was discarded due to a mismatch between the cached parser and the grammar specified in module_ir.py, and, if so, emits a warning that the cached parser was not used, along with informational messages on the nature of the mismatch. Adjusted the "warning" color from magenta to yellow. (This is the first warning in Emboss, so no magenta messages would have ever been emitted.) Adjusted the "note" color from "bright black" (dark grey) to "white" (light grey), becaused at least some terminals display "bright black" as just black.
v2024.1011.195933
Replace `WhichOneof("x")` with `which_x`. (#197) This change refactors `OneOfField` so that all fields in a given `oneof` construct share the same backing attributes on their container class -- `which_{oneof name}`, which holds the (string) name of the currently-active member of the oneof named `{oneof name}` (or `None` if no member is active), and `_value_{oneof name}`, which holds the value of the currently-active member (or `None`). This avoids looping through field specs in order to do an update or to figure out which member of a `oneof` is currently active. Since the `WhichOneof()` method is now a trivial read of a similarly-named attribute, it can be inlined for a small decrease in overall code size and without sacrificing readability. As a result of these changes, the compiler now runs 4.5% faster on my large test `.emb`.
v2024.1010.220729
Fix test name. (#203)
v2024.1010.183549
Cache the generated parser tables as a .py file (#196) This change adds a checked in, cached copy of the parser tables, which will normally be used instead of generating a fresh set of tables. On my machine, this saves approximately 2.05s on first run of `embossc`, and 4.96s after `.pyc` files have been generated. For a small `.emb` file, those savings translate to approximately 36% and 87% of the current total runtime, respectively. In order to minimize frustrating cache decoherence problems, there are two additional features: * When loading the cached parser, the set of grammar productions that were used to generate the cached parser is compared to the current set. If they do not match, the cached parser is ignored, and a fresh parser is generated. This allows developers to work on `module_ir.py` without manually regenerating the parser tables on every change. * The new `cached_parser_is_up_to_date_test` will fail if the cached parser text is not an *exact* match for the text that would be generated from a fresh run of `generate_cached_parser`. This ensures that the version of `cached_parser.py` that is in the master Emboss repo is always up to date, no matter what might have changed in the source tree.
v2024.1010.180834
Merge pull request #182 from reventlov/pylint_misc_harmless Fix miscellaneous harmless lints.
v2024.1010.004723
Add a page of useful links for developers. (#199)
v2024.1009.230010
Merge pull request #200 from reventlov/debug_stop_after_step Add `--debug-stop-before-step` flag.