-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitfield improvements #1492
Bitfield improvements #1492
Commits on Aug 14, 2023
-
Fix comparison for resolved operators.
The `isEqual` method was implemented in the base class, which led to wrong template types being used. A subsequent commit will depend on this working correctly, including a test breaking if not.
Configuration menu - View commit details
-
Copy full SHA for 8fb825b - Browse repository at this point
Copy the full SHA 8fb825bView commit details -
Move
bitfield
type from Spicy to HILTI.This prepares for making `bitfield` a fully-supported HILTI type. This change only moves existing code over to HILTI without breaking Spicy-side functionality. There are still HILTI-side pieces missing for providing full support, which will come next.
Configuration menu - View commit details
-
Copy full SHA for 901679f - Browse repository at this point
Copy the full SHA 901679fView commit details -
Implement remaining pieces to make
bitfield
a full HILTI type.We keep representing bitfields as a C++ tuple behind the scenes, but no longer map it into a HILTI-side tuple as well. Instead `Bitfield` is now a regular type with corresponding operators and runtime functionality. The one change to the C++ tuple representation is that we add an additional hidden tuple element at the end that stores the original integer value. That allows for displaying it (which we will do for now only inside Spicy debug output) and could later also facilitate modifying fields and reconstructing an integer.
Configuration menu - View commit details
-
Copy full SHA for 0f6ac48 - Browse repository at this point
Copy the full SHA 0f6ac48View commit details -
Configuration menu - View commit details
-
Copy full SHA for e55296b - Browse repository at this point
Copy the full SHA e55296bView commit details
Commits on Aug 22, 2023
-
Allow to directly access members of anonymous bitfields.
This works now: type Foo = unit { : bitfield(8) { x: 0..3; y: 4..7; }; on %done { print self.x, self.y; } }; Closes #1468.
Configuration menu - View commit details
-
Copy full SHA for f3a8bdf - Browse repository at this point
Copy the full SHA f3a8bdfView commit details -
Include a flag into a unit field's type information indicating if it'…
…s anonymous. This preservers the information if a field had a name even though internally we do carry a generated dummy name around in that case. For now, we just adapt `spicy-dump` to not print the dummy name in that case in its text output. Later, Zeek will leverage this when auto-generating record types.
Configuration menu - View commit details
-
Copy full SHA for cf081d4 - Browse repository at this point
Copy the full SHA cf081d4View commit details -
[spicy-dump] Change format how bitfields are printed.
We now render them as key/value form in both text and JSON output.
Configuration menu - View commit details
-
Copy full SHA for d8b7734 - Browse repository at this point
Copy the full SHA d8b7734View commit details -
[spicy-dump] Make offsets in JSON output useful.
We were including offsets into spicy-dumps JSON output, but there was no information in there saying which offsets belong to what field. Turning `__offsets` from an array into a map indexed by field name now.
Configuration menu - View commit details
-
Copy full SHA for a7c99a6 - Browse repository at this point
Copy the full SHA a7c99a6View commit details -
[spicy-dump] Level up anonymous bitfields.
Spicy-dump now renders items of anonymous bitfields at the parent level. Offsets are added accordingly as well if requested.
Configuration menu - View commit details
-
Copy full SHA for 33f5855 - Browse repository at this point
Copy the full SHA 33f5855View commit details