-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
area:compilerRelated to code compilation or type checkingRelated to code compilation or type checkinggood-first-issueAn issue considered simple enough for new contributorsAn issue considered simple enough for new contributorskind:refactorInternal changes not affecting the compiler behaviorInternal changes not affecting the compiler behaviorstatus:help-wantedOpen for contributorsOpen for contributors
Description
Originally posted by @ForNeVeR in #617 (comment)
Currently, we have a global static counter, CurrentIndex in the Cesium.CodeGen.Contexts.VariableInfo record.
Cesium/Cesium.CodeGen/Contexts/VariableInfo.cs
Lines 7 to 11 in f1b5204
| internal record VariableInfo(StorageClass StorageClass, IType Type, IExpression? Constant) | |
| { | |
| static int CurrentIndex = 0; | |
| public int Index { get; } = checked(CurrentIndex++); | |
| } |
I'd like to have some sort of indexing that's tied to the translation unit.
Such a counter is too error-prone: it will easily overflow on 2 billion variables constructed in a single compilation session. Moreover, this construct makes it impossible to copy a VariableInfo.
Metadata
Metadata
Assignees
Labels
area:compilerRelated to code compilation or type checkingRelated to code compilation or type checkinggood-first-issueAn issue considered simple enough for new contributorsAn issue considered simple enough for new contributorskind:refactorInternal changes not affecting the compiler behaviorInternal changes not affecting the compiler behaviorstatus:help-wantedOpen for contributorsOpen for contributors