Skip to content

pref: cleanup Backend and CompilerType functions, make minor performance adjustments#21389

Merged
spytheman merged 3 commits intovlang:masterfrom
ttytm:pref/bakend-ct-perf
Apr 30, 2024
Merged

pref: cleanup Backend and CompilerType functions, make minor performance adjustments#21389
spytheman merged 3 commits intovlang:masterfrom
ttytm:pref/bakend-ct-perf

Conversation

@ttytm
Copy link
Copy Markdown
Member

@ttytm ttytm commented Apr 30, 2024

The PR does a cleanup and makes minor adjustments. E.g., sorting match arms for more relevant matches first, adding a gcc arm instead of using it only in the fallback.

if b.is_js() {
res.output_cross_c = true
}
if b == .wasm {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need a b.is_wasm() to align with the other backends.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay checking, it's correct as it is. For the backends there only is .wasm. For the oses there is:

		.wasm32,
		.wasm32_emscripten,
		.wasm32_wasi,
		// Native wasm options:
		.wasi,
		.browser,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are several js output variations as well...

Note that `js` defaults to the `node` codegen backend but it's also possible to
pick another:

* `js_browser`        - V outputs JS source code ready for the browser.
* `js_node`           - V outputs JS source code to run with nodejs.
* `js_freestanding`   - V outputs JS source code with no hard runtime dependency.

wasm is definitely set up different from the others, if it differentiates via os rather than backend.

Co-authored-by: Delyan Angelov <delian66@gmail.com>
@spytheman spytheman merged commit 927cc01 into vlang:master Apr 30, 2024
@ttytm ttytm deleted the pref/bakend-ct-perf branch April 30, 2024 19:56
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.

3 participants