Commit Graph

47 Commits

Author SHA1 Message Date
jiakaiz-g
ac56744927 Add compiler overrides for dex2oat (#8435) 2026-02-09 19:27:57 +01:00
Matt Godbolt
53c7dd328b Configure Biome import organiser with grouped imports (#8431)
Enable Biome's `organizeImports` with groups matching the original
ESLint `import/order` configuration:

1. **Node builtins** (`node:fs`, `path`, etc.)
2. *(blank line)*
3. **Third-party packages** (`express`, `@sentry/node`, etc.)
4. *(blank line)*
5. **Local/relative imports** (`../foo.js`, `./bar.js`, aliases)

This resolves the inconsistency where Biome wasn't enforcing import
grouping, meaning new files would lose the blank-line separation that
the old ESLint config enforced.

### Impact
- **354 files** updated out of 738 checked (~48%)
- **+188 / -240 lines** (net -52) — almost entirely single blank line
additions/removals between import groups
- No import reordering; purely group separator consistency

Fixes #7373

🤖 Generated by LLM (Claude, via OpenClaw)
2026-02-01 20:50:46 -06:00
narpfel
b5c0045556 Adapt isOutputLikelyLlvmIr for Rust (#8253)
The existing heuristics don’t reliably recognise LLVM IR produced by
`rustc` (e. g. when the generated code does not use any LLVM
intrinsics), so this adds LLVM IR detection based on the
`--emit=llvm-ir` and `--emit llvm-ir` command line flags.
2025-11-15 17:16:35 +01:00
narpfel
d21e62d3a1 Fix race condition in Rust opt pipeline view (#8205)
The same race condition that was reported in #7012 also affects the opt
pipeline view.

I couldn’t reproduce the race condition locally, but on the live site it
happens relatively often, e. g. in https://godbolt.org/z/4Y1qfvTvz.
2025-10-22 09:58:21 -05:00
narpfel
685f68450a Don’t add --crate-type to rust compiler options when explicitly specified by user (#8191)
Resolves #8186.
2025-10-13 14:16:01 -05:00
Matt Godbolt
2ae38a0c3f Make argument parsers instances instead of static classes (#8017)
- Made parsers stateful instances instead of shared static state (for
mllvm options). Fixes #8011 as this is caused by multiple clang-based
compilers being run concurrently and stomping over each others' state.
- passes `Compiler` to the constructor, which removes some param passing
- Added some missing awaits
- Tried to get things less dependent on `examples`, only `go` needs it
- Spotted that `zig` c++ might have issues in discovery
- Fly-by fixed a broken go path in ppc64le_gl122
- removed a redundant override in coccinelle
- made the mojo parser actually use the parser it defined
- canonified tablegen's special method
- 

I changed the zig parser too but as best I can tell it was broken before
(the `1` return value from the command it runs:)

```
ubuntu@ip-172-30-0-164:/infra/.deploy$ /opt/compiler-explorer/zig-0.14.1/zig c++ -mllvm --help-list-hidden /infra/.deploy/examples/c++/default.cpp -S -o /tmp/output.s
...
  --x86-use-vzeroupper                                                       - Minimize AVX to SSE transition penalty
  --xcore-max-threads=<number>                                               - Maximum number of threads (for emulation thread-local storage)
/infra/.deploy/examples/c++/default.cpp:1:1: error: FileNotFound
```
return code 1 (means it's not cached)

---------

Co-authored-by: Partouf <partouf@gmail.com>
2025-08-11 12:14:13 -05:00
Ofek
6a0188a5ed Fix #7852: return processRawOptRemarks back to BaseCompiler (#7860)
Co-authored-by: Ofek Shilon <oshilon@speedata.io>
2025-06-24 07:33:53 +03:00
Ofek
d59702383b Fix regression in rustc-nightly opt remarks (#7818)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

Co-authored-by: Ofek Shilon <oshilon@speedata.io>
2025-06-16 21:24:52 +03:00
Ofek
daf15af5ab Fix #7809 plus some refactoring (#7812)
Fix #7809 and then some:

Stop processing opt-remarks if none were requested,
Make gcc dump remarks to file,
separate opt-file handling to ClangCompiler and GccCompiler,
make DefaultCompiler inherit GccCompiler,
move some tests around.
2025-06-16 10:13:32 -05:00
narpfel
91a2d58aa2 Make 2024 the default edition for Rust >= 1.85 (#7649)
Resolves #7472.
2025-05-23 03:01:26 +02:00
Ofek
36715c9369 Support opt remarks for rustc-nightly (#7561)
Closes #7525.
2025-04-12 11:29:38 +03:00
Mats Jun Larsen
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
narpfel
3e36414a34 [rust] switch to -C debuginfo=2 (#7266)
This is mainly for `pahole`, which requires type information that is
only present with `-C debuginfo=2`:
https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo

CE originally passed `-g` to `rustc` (which is an alias for `-C
debuginfo=2`), but this was changed in
c4411ff2a1 to `-C debuginfo=1` to work
around https://github.com/rust-lang/rust/issues/11906. However, this
workaround never actually removed frame pointers, so switching back to
`-C debuginfo=2` should not affect codegen for very old `rustc`
versions. See also #79.
2025-01-13 20:44:11 +09:00
Matt Godbolt
2d09b92b6a Separate filenames for llvm IR in rust (#7171)
Rust compilers output to fixed-named intermediate files. When running a
regular compiler with `--emit-llvm` _and_ an IR view on the same source,
the outputs fight.

This ensures the intermediate files for IR are named differently.

Thanks @bjorn3

Closes #7012
2024-12-02 18:47:28 +02:00
Ofek
63dd5e35a5 Various tsifications (#7025) 2024-10-27 15:28:38 +02:00
Patrick Quist
4fe8397fac Remote execution (#6700) 2024-10-26 17:42:22 +02:00
Ofek
648795d0f5 Unify CompileChildLibraries and SelectedVersionLibraries (#7022) 2024-10-26 15:53:27 +03:00
Ofek
f5f00606f8 Tsifications galore (#6916)
Still mostly mindless numb work, one rename that touched many files
(`getArgumentParser` -> `getArgumentParserCls`), and a few real
improvements.
The goal is to be able to turn on `noImplicitAny` for the project, to
enforce higher code quality. 600 violations to go.
2024-10-01 12:26:46 +03:00
Partouf
6c66940109 bugfix fixIncompatibleOptions 2024-09-29 15:21:37 +02:00
Ofek
9ef46fbafe Binge of (mostly) mindless tsification (#6838)
Turned on `noImplicitAny` in tsconfig, then went around fixing some
random easy stuff.
Hopefully tsification-PRs with more real content coming up.
2024-09-07 14:36:43 +03:00
Ofek
7f8d4eb84d When rust edition appears in both overrides and compiler-options, prefer the options (#6789)
Fix #5429, #6559
2024-08-24 11:06:00 +03:00
Ofek
402c5ec890 Mark the go compiler gc as not supporting cfg (#6470)
Following #6439: mark the go compiler `gc` as not supporting cfg.
Also, don't pass argument to `isCfgCompiler` - the base-compiler
implementation uses `this.compiler.instructionSet` anyway.
2024-05-12 02:16:51 +03:00
Patrick Quist
b8325cf0c6 eslint root setting and fixes (#6307) 2024-04-16 21:26:53 +02:00
narpfel
f5efd390fa Optionally show disambiguating hashes in demangled Rust identifiers (#6265)
Demangled Rust identifiers under the `legacy` name mangling scheme rely
on a hash to disambiguate items with the same name, such as different
monomorphisations of the same function or different closures’
`call_once` methods.

In the `v0` mangling scheme, this is no longer a problem. However,
configuring the demangler to show hashes in `legacy` names will include
crate-id hashes in `v0` names, which are [mostly
unneeded](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#appendix-a---suggested-demangling).

This PR introduces a new checkbox *Options...* → *Verbose demangling*
that lets the user select if they want to include disambiguating hashes
in demangled identifiers.

This checkbox is only shown for compilers that support verbose
demangling, and deactivated when the *Demangle identifiers* checkbox is
unchecked.

Resolves #1754.
Resolves #6255.
2024-04-01 21:58:42 -05:00
Ofek
5b9af2f7b6 Fix #5987: make rustc generate *only* IR output in generateIR (#5988)
All compilations run asynchronously under `await Promise.all` in
`BaseCompiler.doCompilation`:

f3277b8aed/lib/base-compiler.ts (L2256-L2263)

ASM and MIR processing is done from the main `runCompiler` and IR from
the auxiliary `generateIR`. But both compilation calls are passed the
same `options` - which include `--emit asm` for generation of `output.s`
assembly file and `--emit mir=...` for generation of MIR file. So these
2 identically-named file pairs are generated *and cleaned up* in both of
the parallel compilations, sometimes one compilation cleans up its
output before the other one tries to process its own, and mayhem ensues.

This PR makes rust's `generateIR` indeed generate *just* IR by filtering
switches.

From a design perspective: ideally CE would be more opinionated on which
outputs are generated on the main compilation and which on auxiliary
ones. I see no reason for MIR to be generated by an additional switch on
the main compilation and IR require a different compilation (there's
also something called `generateRustHir` - I don't know what it does and
am slightly afraid to ask).
I *think* most (all?) asm/IR outputs could be generated in a single main
compilation, and just post-processed for the different panes in parallel
- which could spell very good news also for servers load. But I don't
dare say anything categorical about *all* languages, compilers and
output (probably no one does). Would be happy to hear opinions.
(Anyway that's just for sake of discussion, this PR does nothing fancy
of that sort)
2024-01-16 07:27:06 +02:00
Ofek
696cc79133 Fix #5630: filter out --emit mir=.. in RustCompiler.buildExecutable (#5991)
With a small added ts'ification in base-compiler.
2024-01-13 22:34:39 +02:00
Ofek
b9c23122be Fix a leftover case of bad file-extension replacement in rust (#5981)
Seems I missed this one when doing PR #5700. This caused *some* of the
grief mentioned in the discussion of issue #5667, but certainly not all
of it.
2024-01-12 22:29:54 +02:00
J. Ryan Stinnett
f0e1d5d264 Add Racket optimisation pipeline (#5836)
This adds a Racket optimisation pipeline view by reusing the existing
LLVM-focused optimisation pipeline UI. A Racket-specific pass parser
translates its output into passes for the UI to present.

This new Racket optimisation pipeline view is currently only enabled for
Racket nightly, as it depends on [recent
changes](https://github.com/racket/racket/pull/4842) to Racket's
compiler output to function.

This also extends the opt pipeline view to allow customising the
function selector label as well as the options and filters for each
compiler where needed.


![image](https://github.com/compiler-explorer/compiler-explorer/assets/279572/f540b41e-fd55-4375-bb2d-a0bb977530b3)

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-11 19:35:45 -06:00
J. Ryan Stinnett
c3e1b04c31 Rename opt pipeline without LLVM prefix (#5828)
This prepares for future work that will reuse the opt pipeline view
outside of the LLVM ecosystem by renaming related components to remove
the LLVM prefix.

The pass dumper keep its LLVM prefix, as it is assumed this part is
likely to be customised for each compiler ecosystem.

The historical component name has been preserved in the component list
as an alias to keep old links working.
2023-12-03 11:33:42 -05:00
fodinabor
e28e67d972 Add new "Debug intrinsics" filter. (#5045)
For now, this removes all `llvm.dbg.*` calls from LLVM IR. This is
useful to keep coloring the line correspondence between source and IR,
while not polluting the IR with the debug intrinsics.

Admittedly, I don't have much of a clue of what's going on here, so I
might be missing obvious adaptions (e.g. can we disable this for all
non-LLVM compilers for now somehow?).
Also, not really a Node.JS testing wizard either... 🤷🏼 

Just wanted this really bad for a workshop that's coming up soon ^^

Only tested with my system's default `clang` for now.

Fixes #5044

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-05-22 22:35:01 -05:00
Patrick Quist
079d495757 Compiler overrides (#5001) 2023-05-16 03:53:57 +02:00
Mats Jun Larsen
633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Jeremy Rifkin
384c297906 Fix trailing comma issue (#4775)
Make trailing commas more consistent throughout the project, fixes
config conflict between eslint and prettier. Resolves an oversight in
#4766.
2023-02-26 12:21:35 -05:00
Jeremy Rifkin
2b06c69111 Turn some auto-fixable eslint rules back on (#4766)
This PR turns comma-dangle and indent eslint rules on for lib/. These
are rules inherited from the eslint config for static/, this PR just
makes things more consistent. Also turned
@typescript-eslint/no-var-requires back on while I was here.
2023-02-23 17:16:17 -05:00
Jeremy Rifkin
563b220cb9 Type work for some handlers and stuff related to the compiler-finder (#4752) 2023-02-22 17:45:55 -05:00
Jeremy Rifkin
6a6efaefe6 Tsify lib/compilers (#4609) 2023-01-29 13:22:30 -05:00
Marc Poulhiès
69055681d9 Support for compiling to binary object (#3232) 2023-01-11 19:39:25 +01:00
Marc Poulhiès
2fa2bbb16a refactor: renames the CompilerFilters type (#4346)
The type which probably started as a real enum of possible post filtering
options now also includes options used for compilers' invocations.

The type was already split, but the naming was not reflecting this in the other
part of the code.

This changes tries to apply a simple renaming to the type only (corresponding
variables are left as 'filters').

While doing so, some typing error were discovered around the GccDump feature.
A fix for this will follow in a different PR.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-11-28 21:37:15 +01:00
Jeremy Rifkin
e13fe4a2f9 Mg/props ts (#4340)
* WIP

* Type changes to the property getter

* Finish getting types working for properties.ts

* Reduce type casts in exec.ts

* Format files

* Remove old comment

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2022-11-26 13:56:04 -05:00
partouf
3f36aa96cb formatting 2022-10-12 18:07:44 +02:00
Rubén Rincón Blanco
0d09aecc19 Fix --emit llvm-ir when asked to emit binary mode (#4131) 2022-10-10 15:29:34 +02:00
Patrick Quist
8334d96bf3 tsify exec.js (#4026) 2022-09-06 20:22:28 +02:00
Rubén Rincón Blanco
105b814acf Fixes wrong types in libraries.interfaces.ts (#3982)
* Fix getLibrary functions

* Fix library.path usage in Zig compiler
2022-08-25 21:45:59 +02:00
Rubén Rincón Blanco
63a88e0baf Adds ability to detect incompatible options & userOptions (#3912)
Also filters it with rust to remove the color==always flag as the first
implementation.
2022-07-26 17:18:31 +02:00
Jeremy Rifkin
edf3fadfe5 Add -fno-discard-value-names support for the llvm opt viewer (#3836)
* Added -fno-discard-value-names support for the llvm opt viewer

* Added -Z fewer-names=no for rustc
2022-07-04 11:32:21 -04:00
Jeremy Rifkin
a0d0eae5ba Added llvm opt pipeline rust support (#3835) 2022-07-04 09:39:18 -04:00
Patrick Quist
ebfa101ef2 Rust library support (#3754) 2022-06-10 01:48:41 +02:00