Skip to content

Cleanup TagEncoding::Direct. Instead of using a function to create a temporary, just directly create the rvalue we need - #1457

Merged
tedinski merged 3 commits into
model-checking:mainfrom
danielsn:codegen-direct-literal
Aug 9, 2022
Merged

tedinski merged 3 commits into
model-checking:mainfrom
danielsn:codegen-direct-literal

Conversation

@danielsn

@danielsn danielsn commented Aug 5, 2022 •

Copy link
Copy Markdown
Contributor

Description of changes:

Currently, we create a function, which creates a struct, assigns to one field of it, and returns.
We then call that function, and use its return value as an rvalue.
But CBMC has rvalue struct expressions, which let us do the entire thing in one expression.

Resolved issues:

Resolves #1456

Call-outs:

Testing:

  • How is this change tested? Existing regression tests. I confirmed that this code is covered by these tests (see issue)

  • Is this a refactor change? No

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@danielsn
danielsn requested a review from a team as a code owner August 5, 2022 02:27
@danielsn
danielsn force-pushed the codegen-direct-literal branch from 1c1a752 to 53dd341 Compare August 5, 2022 03:16
@danielsn
danielsn force-pushed the codegen-direct-literal branch from 53dd341 to 641d2af Compare August 5, 2022 20:49

@fzaiser fzaiser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks! Please just fix that one little issue I mentioned.

@danielsn danielsn self-assigned this Aug 9, 2022
@danielsn
danielsn force-pushed the codegen-direct-literal branch from 641d2af to fc7c607 Compare August 9, 2022 19:15
@tedinski
tedinski merged commit eae6460 into model-checking:main Aug 9, 2022
@fzaiser fzaiser mentioned this pull request Aug 10, 2022
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

codegen_direct_literal should use statement expression

3 participants