Skip to content

cgen: fix codegen for if comptime with -g#22888

Merged
spytheman merged 3 commits intovlang:masterfrom
felipensp:fix_debug_code_if_comptime_code
Nov 18, 2024
Merged

cgen: fix codegen for if comptime with -g#22888
spytheman merged 3 commits intovlang:masterfrom
felipensp:fix_debug_code_if_comptime_code

Conversation

@felipensp
Copy link
Copy Markdown
Member

@felipensp felipensp commented Nov 17, 2024

@felipensp felipensp marked this pull request as ready for review November 17, 2024 17:06
Copy link
Copy Markdown
Contributor

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@spytheman
Copy link
Copy Markdown
Contributor

spytheman commented Nov 17, 2024

The test should be moved as a .vv/.out file pair under vlib/v/gen/c/testdata/ , that has this comment line at its top:
// vtest vflags: -g

It can print anything, for example println('done'), so that the .out file will not be empty.

Otherwise, -g is not passed by default, and the program compiles normally without it on master as well.

@spytheman spytheman merged commit 47c7858 into vlang:master Nov 18, 2024
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.

cgen error when -g is used on a program containing an if expression, with comptime if inside its branches

2 participants