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](63dd5e35a5/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>
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.
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.
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.
_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)
<!-- 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 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!
-->
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.
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>
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.
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.
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.
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](00648a7e1c/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.
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.
<!-- 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
<!-- 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!
-->