Skip to content

Try to remove duplicate type argument from base set#1985

Draft
sim642 wants to merge 4 commits intomasterfrom
base-set-lval-type
Draft

Try to remove duplicate type argument from base set#1985
sim642 wants to merge 4 commits intomasterfrom
base-set-lval-type

Conversation

@sim642
Copy link
Copy Markdown
Member

@sim642 sim642 commented Apr 9, 2026

The set functions in base have two typ arguments:

  1. lval_type, which is a fallback for when some typeOf calculation fails, e.g. for alloc variables.
  2. t_override, which is used instead of the typeOf calculation, e.g. for the return variable.

This is quite confusing and seems excessive. lval_type is always provided from some version of typeOf anyway, so that argument might be redundant.

In this PR, I started to refactor it, but so far did not manage to get all the way. Different places get the lval_type from different things, e.g. Cilfacade.typeOfLval and AD.type_of (which is kind of non-deterministic!).
It's not clear whether the differences are intentional (i.e., these different functions compute different things in some cases) or accidental.

@sim642 sim642 self-assigned this Apr 9, 2026
@sim642 sim642 added the cleanup Refactoring, clean-up label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Refactoring, clean-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant