Skip to content

cgen: add calls to all typeof functions for interfaces and sum-types #17490

Merged
spytheman merged 3 commits intovlang:masterfrom
i582:pmakhnev/interface_sumtype_debugger_improvements
Mar 4, 2023
Merged

cgen: add calls to all typeof functions for interfaces and sum-types #17490
spytheman merged 3 commits intovlang:masterfrom
i582:pmakhnev/interface_sumtype_debugger_improvements

Conversation

@i582
Copy link
Copy Markdown
Contributor

@i582 i582 commented Mar 3, 2023

Add calls to all typeof functions for interfaces and sum-types in debug mode, to be able to call them in the debugger, otherwise the C compiler will optimize them

This will allow the IDEA plugin to add pretty-printers that output concrete types in the debugger.

For example:

…in debug mode, to be able to call them in the debugger, otherwise the C compiler will optimize them
@felipensp
Copy link
Copy Markdown
Member

Does not [markused] already this job?

@i582
Copy link
Copy Markdown
Contributor Author

i582 commented Mar 3, 2023

Does not [markused] already this job?

Does this somehow affect the optimizations that the C compiler does?

@JalonSolov
Copy link
Copy Markdown
Collaborator

[markused] prevents the -skip-unused option from removing the code. It doesn't do anything for the C compiler, as far as I'm aware. @spytheman would know for sure.

Comment thread vlib/v/gen/c/cgen.v Outdated
@spytheman
Copy link
Copy Markdown
Contributor

Does not [markused] already this job?

No, these are generated functions in cgen; [markused] is used on V functions present in the source code.

@spytheman spytheman merged commit 1a48d08 into vlang:master Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants