Commit Graph
2562 Commits
Author SHA1 Message Date
Mats Larsen bb6d374566 Apply automatic fixes 2024-11-10 13:46:36 +09:00
Mats Larsen 63437a2bca Install biome and remove eslint/prettier 2024-11-10 13:46:22 +09:00
Partouf c81ab73e63 hotfix for incompatible GL states 2024-11-08 18:38:41 +01:00
Patrick Quist 29b9fe406d Bugfix Unknown file (#7072) 2024-11-08 17:54:43 +01:00
Patrick Quist 6f97ab5518 Close button fix (#7050) 2024-11-08 16:25:55 +01:00
Sirui Mu a6ca0fed18 Add ClangIR compilation options (#6914)
This patch adds two options to the clangir pane that affects the clangir
compilation pipeline:

* Flat CIR enables the emission of flat clangir CFG;
* -fclangir-mem2reg enables the mem2reg pass on the flat clangir CFG.
2024-11-02 10:53:33 +02:00
OfekandMats Jun 679b908c39 Tooltips for llvm opt output (#7036)
This does fix #7019, but unfortunately in IR lines like -
```
  %2 = mul nsw i32 %0, %0
```
Monaco assigns both the `mul` and `nsw` tokens with type
'operators.llvm-ir' (handled as asm keyword by this PR) and requests the
backend for their docs. Only `mul` is an actual documented keyword -
`nsw` is just a modifier and the request fails with errors like `GET
http://localhost:10240/api/asm/llvm/nsw 404 (Not Found)` thrown at
[getAssemblyDocumentation](https://github.com/compiler-explorer/compiler-explorer/blob/63dd5e35a5856bcd1670b7b1cf21ffd854928ef7/static/api/api.ts#L50-L51).

This draft PR is meant for discussion. Would it be enough eg to wrap the
request in `getAssemblyDocumentation` in a try-catch? Maybe the right
thing to do would be to intervene in the monarch parsing for llvm-ir?
Other ideas that I'm missing?

---------

Co-authored-by: Mats Jun <mats@jun.codes>
2024-10-28 19:41:38 +09:00
Mats Larsen ef0c9f5ded Don't use sinon/chai code for frontend tests
Using these imply that sinon and chai will be built for the final bundle that the user downloads. This is not a good thing, because it bloats our bundle.
2024-10-28 18:59:56 +09:00
Mats Jun 9e1a42288b Remove legacy test dependencies (#7034)
Replaces sinon mocks with cy and removes deep-equal-in-any-order

Removes any old chai imports
2024-10-28 18:12:58 +09:00
narpfel 01a873ab27 Reintroduce [already open] for “new tool” buttons (#7035)
Fixing the merge conflicts in #6974 accidentally removed the
`new-pane-button` class from the buttons in the “Add tool...” menu from
#7002:

https://github.com/compiler-explorer/compiler-explorer/pull/6974/files#diff-40ca496bc7fcf6c9bcd41d530708fe3a7bcc5f58cd9bad27ab919b5033f557deL2695-L2696

See https://godbolt.org/z/fd7v8zfE5 (click on “Add tool...”, `ldd` is
disabled but does say `[already open]`).

This PR reintroduces that change. However, the implementation in #7002
would also show `[already open]` for the “No tools available” button if
there are no tools. In this PR, the `new-pane-button` class is only
added to the “real” new tool buttons.
2024-10-28 16:43:31 +09:00
Ofek b6386887a8 Make 'new source editor' preserve the origin language (#7031)
When doing 'Add new...'/'Source editor' from, e.g., a Rust editor - open
a new Rust editor and not a C++ one.


![image](https://github.com/user-attachments/assets/861c53bc-fb1e-44c0-ac23-09d2ac839bdb)
2024-10-27 11:06:51 +02:00
Ofek a0fe0e3d4f In diff view, protect against undefined asm (case of a failed build) (#7030)
Fixes #7029
2024-10-27 09:20:31 +02:00
Ofek ab4b662ee0 Extra safety around executeParameters.args (#7028)
Hopefully fixes #7027
2024-10-27 09:09:44 +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 c312beae24 TSify StackUsage and others (#7021) 2024-10-26 11:35:35 +03:00
Ofek 4e5348ab77 Tsify tools (mostly) (#7018)
This includes among others:
 - Proper tsification of various tools code,
 - Elimination of the `CompilationInfo2` type,
 - Use of `CompilationInfo` instead of `Record<any, any>` in some places
 - These lines in CompilationResult:
```
    // Temp hack until we get all code to agree on type of asm
    asm?: ResultLine[] | string;
```

The next task would be to get all code to agree on the type of
CompilationResult.asm, thereby enabling fixing of most the remaining
TSification.
2024-10-26 10:58:30 +03:00
Ofek 93133510c2 Move ToolState to component.interfaces, to avoid duplicate tool.interface.ts 2024-10-25 22:02:30 +03:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +03:00
narpfel 02b574b4a9 Show that pane is already open when disabling the button to create a new pane (#7002)
When a new pane (such as the LLVM IR view) is opened using a button in
the “Add new...” or “Add tool...” menu, the button is disabled. This can
be confusing when the pane is not visible (e. g. when it is in a tab in
the background), because it can also be interpreted as “this is not
supported“.

This PR adds an `[already open]` to the button when it is disabled.
2024-10-24 21:24:54 +03:00
Ofek e98d361127 Add display for internal compiler id (#7010)
Implement #6985
2024-10-24 14:28:51 +03:00
Ofek 2df8d32758 Tsify #6 (#6941)
Another tsification batch. 347 to go and I'm running out of easy fixes
:(
2024-10-22 21:41:44 +03:00
Mats Jun 6753449778 Simplify TypeScript types for JQuery elements (#6991)
_No functional changes intended_

The existing type functions a little like this:

"Take the intersection of all common properties of all values in
HTMLElementTagNameMap"

This very much just happens to be the same as HTMLElement, since that's
the declared base for all of the types in HTMLElementTagNameMap. This
small patch simplifies this type (and makes it significantly easier to
read the code)
2024-10-22 19:33:03 +09:00
Matt Godbolt 5e4b209125 Minor bump (#6986) 2024-10-20 18:03:08 -05:00
Ofek d23b327153 A few leftovers that escaped the google-analytics cleanup (#6979)
<!-- 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!
-->
2024-10-19 22:00:12 +03:00
Johel Ernesto Guerrero Peña 601c3ec3d7 feat: update grammar of Cpp2 (#6950) 2024-10-12 18:37:29 +02:00
Ofek caca3ea6c7 Eliminate all google-analytics dead code (#6954)
<!-- 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!
-->
2024-10-10 21:21:43 +03:00
Patrick Quist e259b275cc Remember the compiler pickers isa and group filters + search (#6931) 2024-10-08 22:04:17 +02:00
Ofek 9dd45914aa Tooltips for llvm ir (#6937)
The docenizer was there - just needed some updating.

There is some duplicity created between `ir-view` and `compiler` that I
hope to address in a future PR.
2024-10-07 08:37:10 +03:00
Ofek 709b1f168b First-aid for opt-pipeline on clangir 2024-10-01 11:36:57 +03:00
Spencer FrickeandMatt Godbolt 69241006aa Add preliminary GLSL support (#6883)
Part of
https://github.com/compiler-explorer/compiler-explorer/issues/2331
Inspired by
https://github.com/compiler-explorer/compiler-explorer/pull/3932

I think it is great that HLSL has support here, but the lack of GLSL
support is what stops me from using Compiler-Explorer more often. LunarG
also have shown in our [yearly ecosystem
survey](https://www.lunarg.com/wp-content/uploads/2024/04/2024-Vulkan-Ecosystem-Survey-Results-04-04-2024.pdf)
that GLSL is very widely used in the GPU space

![image](https://github.com/user-attachments/assets/ec740d61-0bf4-42b2-8e51-c204819aba11)

A while ago I started to create [my own SPIR-V
tool](https://github.com/sjfricke/SPIRV-Playground) but was given
feedback to "please just spend your free-time efforts making
compiler-explorer better for SPIR-V instead" ... to which I agree (since
seems a LOT of ground work was already laid out for me 😄 )

So here it is, a working version of GLSL using `glslang` 🚀 


![image](https://github.com/user-attachments/assets/2fc67890-1cd2-4b7e-82c2-30ca135f8590)

I guess beside reviewing my very unused Typescript skills, I know we
will need to add things to the Infra repo to get things public. For that
I am not sure what the best course of action is, we do have [rolling
releases](https://github.com/KhronosGroup/glslang/releases/tag/main-tot)
of `glslang` as well as SDK version tags

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2024-09-30 22:19:55 -05:00
Ofek 7097a240a7 Introduce opt-pipeline for ClangIr (#6917)
Thank @Lancern for the CIR flags analogous to clang's
`--print-before|after-all.`


![cir](https://github.com/user-attachments/assets/78742d83-799d-40cd-bcef-7a2e69a83c54)
2024-09-30 22:11:30 -05:00
Christoffer LernoandPatrick Quist c419ad593a Update C3 default compiler and do some further fixes to C3-mode. (#6853)
This adds 0.6.2 to the list of C3 compiler versions, and corrects the
operators in c3-mode.

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-09-30 21:46:15 -05:00
Johel Ernesto Guerrero Peña 36520c83fd feat: update grammar of Cpp2 (#6913) 2024-09-28 18:08:27 +02:00
Ofek f715dc2932 More tsification (#6877)
About half way through. Only 708 tsification errors to go..
2024-09-28 10:32:36 +03:00
Sirui Mu a49dbc6dd7 Add ClangIR output for clangir compiler (#6798)
Currently the clangir compiler is implemented by a special clang variant
whose compilation options list gets appended with `-Xclang -fclangir
-Xclang -emit-cir`. This introduces a problem: we no longer gets access
to its LLVM IR output and assembly output because `-emit-cir` is an
exclusive option.

This patch resolves this problem by introducing a new ClangIR pane,
similar to the LLVM IR pane or Rust MIR pane. A new output kind named
`ClangIR` is added to the "Add new..." drop down menu and it toggles the
ClangIR pane. This patch then removes `-Xclang -emit-cir` from the
options list of the clangir compiler. The clangir compiler will then
output assembly code just like other clang compilers. The removed
options will be added back when compiled from the ClangIR pane.
2024-09-12 19:43:26 +03:00
Matt Godbolt 72d2fdccc1 Apply the font scale when we know the target (#6849)
This fixes an ordering issue with font scales. The issue would happen if
you changed the default font scale and then e.g. opened a tool window.
It would have the "default" size selected; but it wouldn't apply to the
editor window.
2024-09-10 16:00:13 -05:00
Ofek 730a45c2c7 Fix #6801: handle changeLangage before selectize initialization (#6811) 2024-09-07 10:11:23 +02:00
Patrick Quist 3a278ad3b3 Add library lookupname to support binary builds for boost (#6814) 2024-09-04 19:18:37 +02:00
Ofek d6f0807e9f More fixes for pane-renaming in various scenarios (#6781) 2024-08-22 11:00:00 +03:00
Ofek 09fc2c1ca4 Final (?) pane-renaming fix (#6774)
Some major-ish fixes to tree and minor fixes in multifile-service.
This hopefully fixes #6770, #5734, and maybe others.
2024-08-21 23:42:26 +03:00
Ofek d83bb38f1a add paneName fallback to filename in editor.getPaneName() (#6773) 2024-08-18 09:57:13 +03:00
Ofek 12f6bfcc12 Make pane-renaming central (#6772)
When each `Pane` (and others) create their own `PaneRenaming`, which
extends `EventEmitter.EventEmitter`, when one actor emits `renamePane`
no other actor can hear it.

This PR makes `PaneRenaming` stop using its own event emission, and
instead use the central `Hub` it now receives at its ctor.
2024-08-17 22:51:11 +03:00
Ofek 4cdef67bba fix Alert (#6771)
All `Alert` modal windows reuse the same yesButton/noButton.
The callback are setup in the Alert ctor -
```
        const yesNoModal = $('#yes-no');
        yesNoModal.find('button.yes').on('click', () => {
            this.yesHandler?.();
        });
        yesNoModal.find('button.no').on('click', () => {
            this.noHandler?.();
        });
    }
```
On every yes/no click, *All* callbacks of *All* alert instances are
called.
So each `Alert` instance needs to cleanup its callbacks after usage, and
it tries to - via the weirdly named `toggleEventListener`.
`toggleEventListener` only did

```
element.off(eventName);
```
Some of the renaming problems were caused by persistance of [this
callback](https://github.com/compiler-explorer/compiler-explorer/blob/00648a7e1c38c9172c5226d1f64511b8bebfe1c9/static/widgets/pane-renaming.ts#L68-L72).
Extending the cleanup to -
```
        element.off(eventName);
        this.yesHandler = null;
        this.noHandler = null;
```
seems to solve it this particular problem - not even sure `element.off`
is even needed.
2024-08-17 22:50:46 +03:00
Ofek a99edaf5bf Fix opt-remarks / stack-usage font size in all themes - not just default (#6751)
Leftover from PR #6671
2024-08-04 16:11:37 +03:00
narpfel 3beeef8fe3 Implement more diff types (#6730)
Add support for diffing clang ASTs, LLVM IR, and Rust HIR, MIR and macro
expansions. These new options are only shown in the picker when the
compiler supports the respective output type (e. g. when diffing `g++`
output, there will be no item to select LLVM IR).

Because the specified output must be activated manually, this PR also
adds help texts so that the user isn’t shown an empty pane. E. g. when
diffing execution stdout but “Execute the code” is not checked, the diff
viewer will show “<activate 'Output...' → 'Execute the code' in this
compiler's pane>”.

Resolves #6726.
2024-07-29 22:19:59 -05:00
Christoffer Lerno a8b0030858 Add 0.5.5, 0.6.0, 0.6.1 C3 versions. Remove incorrect keywords from C3. (#6728)
<!-- 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!
-->
This updates C3 with 0.5.5/0.6.0/0.6.1 and removes some long gone
keywords. This also renames "0.4 -> 0.4.0" and "0.5 -> 0.5.0". The new
versions are in the infra pull request here:
https://github.com/compiler-explorer/infra/pull/1374
2024-07-29 21:21:03 -05:00
Ofek 9857667ad1 The 2s-delay experiment was never deployed... Restoring it 2024-07-24 14:43:41 -04:00
Ofek 89c33d9d70 After a 10 day experiment, decrease defaultDelayAfterChange back (#6719)
… to 1.5sec
2024-07-23 18:43:00 -04:00
Ofek 2055f087d5 Make scroll-up increase the font size and scroll-down decrease it (#6705)
Just feels more natural
2024-07-23 16:22:46 -04:00