diff options
| author | Theresa Foley <10618364+tangent-vector@users.noreply.github.com> | 2025-06-30 18:20:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-01 01:20:33 +0000 |
| commit | 6231a6830880f650e444405b670ed7cc0987184b (patch) | |
| tree | 7e0639df3740aa6042c6fe688203f43ef07a6329 /include/slang.h | |
| parent | ca21304d0bca7fdde9f5ab3f23129a553dd2408b (diff) | |
Remove some cruft/complexity from IR serialization (#7483)
* Remove some cruft/complexity from IR serialization
This is a very simple cleanup to unnecessary code paths and remove some flexibility that isn't actually needed, to hopefully simplify the task of more completely overhauling the approach to IR serialization in a later change.
The concrete feature that gets removed here is a debug-only feature (which thus shouldn't be affecting any users of Slang) that was added long ago in the life of the compiler as we were working to truly separate the front- and back-ends.
At the time there was a lot of code in the compiler back-end that still made use of AST-level data structures, and thus got in the way of our goal to support separate compilation and linking (such that final code generation can only depend on the IR, and not the AST).
The option was used to cause the Slang IR to be serialized out and then read back in as part of compilation, to try and enforce that only the wanted constructs could pass through that bottleneck.
The idea was only ever half implemented, however, because it made use of a secondary implementation path in IR serialization that supported serializing the "raw" source locations (which are heavily dependent on AST-level information, even down to the number of bytes in source files).
This change removes the feature entirely, since it is no longer useful for its intended purpose, and its presence causes there to be entire second code path for source locations in IR serialization that would need to have test coverage if we wanted to be sure it kept working.
In addition, our pre-existing infrastructure for module serialization had various options that have either stopped being useful, or were not really useful at the time they were introduced.
For example: there are no places in the code today where we attempt to serialize out a module without including both the serialized AST and IR.
If that was a feature that we ever supported, the relevant code got removed at some preceding point without breaking any of our tests or (seemingly) upsetting users.
Similarly, the options being passed into writing of a serialized module included both a flag to control whether source locations should be serialized *and* a pointer to the `SourceManager` to use in that case... but it was only ever meaningful to set both, or neither.
The option has been changed to just be the `SourceManager` pointer, and the name has been updated to reflect its very narrow intended use case.
* format code
* fixup
* regenerate command line reference
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'include/slang.h')
| -rw-r--r-- | include/slang.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/slang.h b/include/slang.h index ba247aadd..0ee9496ef 100644 --- a/include/slang.h +++ b/include/slang.h @@ -963,9 +963,9 @@ typedef uint32_t SlangSizeT; PreprocessorOutput, OutputIncludes, ReproFileSystem, - SerialIr, // bool - SkipCodeGen, // bool - ValidateIr, // bool + REMOVED_SerialIR, // deprecated and removed + SkipCodeGen, // bool + ValidateIr, // bool VerbosePaths, VerifyDebugSerialIr, NoCodeGen, // Not used. |
