Commit Graph
657 Commits
Author SHA1 Message Date
narpfel 7974f78e08 Also demangle quoted identifiers in LLVM IR (#6560)
This fixes one of the two problems reported in #6558.
2024-06-07 20:49:45 -05:00
Jason Francis 97a39232b2 Detect local label assignments as directives on MIPS (#6392) (#6467) 2024-05-29 18:13:16 +02:00
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02:00
Ofek bcb397f56b Add noUnusedLocals to tsconfig + fix the new alerts (#6396)
<!-- 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-05-14 18:46:22 +03:00
Patrick Quist 8d3ba37fec Fix duplicated filters in logging (#6399) 2024-04-27 16:57:31 +02:00
Matt Godbolt f358067cec Migrate to eslint-plugin-n; as ...-node is deprecated (#6387)
Replaces #6310
2024-04-23 06:45:55 -05:00
Matt Godbolt e63f71a1bb More structured logging of compiles (#5105) 2024-04-22 21:25:13 +02:00
Patrick Quist adb8bd774a Dynamic instruction set for documentation (#6173) 2024-04-22 18:40:56 +02:00
Matt Godbolt c1ed64473e Use vitest instead of approvals (#6366)
Move to using `vitest`'s built-in behaviour, or nearer to it. Rename all
the txt to `.json` files, as that's what they are.

A bit of a workaround, though we might decide to keep it.

To update the "expected" you can run `npx vitest test/filter-tests.ts
--update` or similar.
2024-04-18 20:19:43 -05:00
Patrick Quist f30113cc6f disable filter-tests for windows (#6365) 2024-04-15 23:55:38 +02:00
Patrick Quist 43323b7b6c fix part of the windows tests (#6351) 2024-04-15 03:57:24 +02:00
Jeremy RifkinandPatrick Quist 15271c9090 Fix missed demangles (#6350)
This PR fixes missed demangle cases pointed out in #6348, namely of the
form `mov eax, OFFSET FLAT:_Z...` and `jmp qword ptr [rip + _Z...]`.

Closes #6348.

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-04-13 13:54:49 -05:00
Matt Godbolt 653a214f39 Fix a test that used relied on toMatch matching an array 2024-03-30 13:53:04 -05:00
narpfelandPatrick Quist 077f9c99cf Decode UTF-8 encoded strings in numeric tooltip (#6234)
Compilers like to encode short-ish strings into immediate arguments to
various assembly instructions. This makes it hard to read the assembly.

To improve readability, show a string representation of a number’s bytes
when they’re valid UTF-8.

This now also shows a string representation for *unprintable* ASCII
characters, such as `10` being shown as `"\n"` or `1` as `"\u0001"`.

Resolves #6220.

## Examples

([link](https://godbolt.org/z/7hzn6b8YG))

* 8583909746840200552: `8'583'909'746'840'200'552 =
0x7720'2C6F'6C6C'6568 = 6.5188685003648344e+265 = "hello, w"`
* 1684828783: `1'684'828'783 = 0x646C'726F = 1.74467096e+22f = "orld"`
* -6934491452449512253: `-6'934'491'452'449'512'253 =
0x9FC3'BCC3'B6C3'A4C3 = -1.1500622354593239e-155 = "äöüß"`
* 1633837924: `1'633'837'924 = 0x6162'6364 = 2.61007876e+20f = "dcba"`
* 97: `97 = 0x61 = 1.35925951e-43f = "a"`
* 10: `10 = 0xA = 1.40129846e-44f = "\n"`
* 92: `92 = 0x5C = 1.28919459e-43f = "\\"`

## Open questions

* The code assumes little-endian encoding, so the string representation
is reversed compared to the numeric representation (see `integer`
example). Should this be configurable or should the bytes not be
reversed?
* Negative numbers are masked to 64-bit unsigned ints (same as in the
hex representation), so if the number is shorter than 8 bytes, it has
some leading `ff` bytes and is not valid UTF-8 (see
`small_negative_number` in the example link). Is this an acceptable
limitation?
* I'd like to add some tests for `getNumericToolTip`, but I’m not really
familiar with TypeScript. I tried to importing
`static/panes/compiler.ts` in a test file, but
([after](https://github.com/vitest-dev/vitest/discussions/1806#discussioncomment-3570047)
some [struggling](https://vitest.dev/config/#environment)) it seems that
that file needs a [specific DOM
element](https://github.com/compiler-explorer/compiler-explorer/blob/3c26c64ca320853cb383b3751d3e08a86b581639/static/options.ts#L27)
that is not present during testing. The simplest solution I could come
up with is moving `getNumericToolTip` into another file (such as
`static/utils.ts`). Is that okay or is is it possible test
`static/panes/compiler.ts` some other way?

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-03-17 12:43:43 +02:00
Matt Godbolt fd3dd917f5 Vitest (#6219)
Port to vitest. Port everything to typescript. Remove chai, mocha and
chai-as-promised. Adds some docs.
2024-03-08 22:25:09 -06:00
narpfel 10c6074073 Add digit separators to long numbers in numeric tooltip (#6221)
Long numbers are sometimes hard to read in the numeric tooltip. To
improve readability, this PR adds language-specific digit separators to
the numeric tooltip.

Decimal numbers are grouped into chunks of three digits while
hexadecimal numbers are grouped into chunks of length four.

The digit separator is language-specific and chosen so that the number
is a valid token in the source language.

[Examples](https://godbolt.org/z/s86cMbjeK):
* for C++, hovering the number `8583909746840200552` shows this tooltip:
`8'583'909'746'840'200'552 = 0x7720'2C6F'6C6C'6568 =
6.5188685003648344e+265`
* for Python, hovering the number `-12345678` shows this tooltip:
`-123_456_789 = 0xFFFF_FFFF_F8A4_32EB = -2.66427945e+34f`

For languages that don’t have a `digitSeparator` set, the tooltip is not
changed.
2024-03-05 20:11:39 -06:00
Matt Godbolt b658e25f6f Support colour background for think-cell (#6223) 2024-03-05 20:11:28 -06:00
Marc Auberer c8f0409c25 Accept tail calls for llvm.dbg filters (#6129)
This adds support for filtering tail calls to `llvm.dbg.*` intrinsics
using the regex-based filter mechanism.
Previously, normal calls were filtered out, but tail calls are not
caught by the regex so they remained in the output.
Example with the previous state: https://play.spicelang.com/z/MGGn98
2024-02-12 21:52:45 -06:00
Patrick Quist 4605ebfb4b Add Fortran library support (#5533) 2024-02-09 23:31:05 +01:00
Patrick Quist 68efdcbd97 transform paths given through options.ldPath (#6086) 2024-02-04 16:51:46 -06:00
Matt Godbolt 01b7992ada Fix nsjail environment variables that need mapping to destination paths (#6084)
Maps env vars just like we map everything else, to catch all cases where
"app dir" is an input to jailed processes, the jailed process only sees
the "right" path (`/app/something`).

Tested locally and fixes the dot net "read only `/nosym`" thing while
keeping the `/nosym` behaviour etc
2024-02-04 13:53:50 -06:00
Matt Godbolt c26a2924fc Add more typings (#6082) 2024-02-04 13:33:19 -06:00
Matt Godbolt ba215bdc37 Support a new sponsor layout (#6063) 2024-01-29 22:16:14 -06:00
Matt Godbolt 613d7f688a Unify the way tmp dir is used (#6052)
Instead of having several globals, set via environment variables,
explicitly set the "correct" env var if passed `--tmpDir` and then
consistently use it in the rest of the program.

See @apmorton's comments in #1707
2024-01-28 18:50:46 -06:00
Matt Godbolt 24c4ef7d1c Bump timeout on packager tests to deal with flakiness 2024-01-15 18:40:36 -06:00
kevinjeon-g 2f6a7328b2 Add support for dex2oat (latest) (#5916)
Adds Dex2OatCompiler, which applies to the Android Java and Android
Kotlin languages. Dex2OatCompiler runs on .dex files output by
D8Compiler, which in turn runs on .class files output by JavaCompiler or
KotlinCompiler. A parser has been added for dex2oat optimization passes.
2024-01-15 15:15:05 -06:00
Patrick Quist 730437464d Fix semver ordering for libraries (#5959)
Fix #5951
Fix #5085

Extended the fictitious version number for non-numbers, so that trunk
can be listed higher than a `yyyymmdd` as a version (EVE uses this)
2024-01-08 22:10:25 -06:00
partouf a7c514ac6d fix unittests 2024-01-01 20:18:23 +01:00
Ofek a62c5a84b5 Fix #5889: add block-lookahead logic to processAST (#5903)
The code here assumes a top-level AST subtree can be in 3 states:
1. The header line indicates it's system code (e.g. includes `/usr`
etc.)
 2. The header line indicates it's user code (includes `<source>`)
3. The header contains no such info (typically it includes `<invalid
sloc>`)

For the 3rd case this PR looks-ahead inside the current subtree and
decides based on its contents.
This is enough to filter out `<vector>` or `<string>` contents, as
demonstrated in issue #5889 (added a test). This solution holds also for
the case from issue #3849.
2023-12-28 16:10:09 +02:00
J. Ryan Stinnett e7b22b41be Limit exec streams to max string length (#5898)
Some operations set `exec`'s `maxOutput` to a value larger than the max
string length. This change ensures we always cap output to the engine's
string limit (currently 512 MB in recent Node versions).

This also tweaks handling when reaching the string limit to ensure
adding the "truncated" message itself does not send us beyond the limit.
2023-12-23 17:54:46 -06:00
Matt GodboltandJeremy 32ddf75adc Update to ts5 (#5879)
Co-authored-by: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com>
2023-12-18 20:11:11 -06:00
J. Ryan StinnettandMatt Godbolt 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
Matt Godbolt 87e4d460df Cache AWS creds at startup and reuse (#5814)
Also errors early if we can't get them at all, and configures retries
and timeouts

Mitigation for #5813
2023-11-27 22:32:04 -06:00
Ofek c0db47487c Fix #5784 (#5793)
Fix the name of the entry block in an IR control flow graph.
2023-11-27 10:33:03 -05:00
Patrick Quist 04efa86241 Changes to support CMake for Windows (#5769) 2023-11-22 03:06:26 +01:00
partouf 72af7a5ed6 add unittest for paths 2023-11-21 14:52:09 +01:00
Ofek 31bd47909f Fix #4931 and #2218 (#5706) 2023-11-11 13:56:25 +01:00
Patrick Quist d5fd1ae3a7 Fix shared state close issue (#5725) 2023-11-10 00:13:53 +01:00
Patrick Quist 455d92916a Execution with heaptrack (#5644) 2023-11-07 23:59:40 +01:00
partouf e4f2bf6b42 update clientstate with filter binaryObject & libraryCode 2023-11-07 18:19:07 +01:00
David Spickett 971889e5d7 LLVM TableGen: Add actions to Overrides menu (#5699) 2023-11-04 20:54:43 +01:00
Ofek bb66fc6a97 Fix #5694 (#5703) 2023-11-04 20:54:24 +01:00
Jeremy c122979cb4 Fix tests so the ts tests are ran 2023-11-03 12:44:46 -04:00
Matt Godbolt edeca232c5 Handle errors in the LLVM transform (#5690)
Previously an error in e.g. YAML parsing would take down the whole
process.

Part of #5686 but doesn't fix the underlying issue.
2023-10-30 19:40:45 -05:00
Jeremy be5a980247 Relax asm parse time test threshold for github CI being slow 2023-10-24 15:30:00 -04:00
partouf 46b45a87b9 extra unwrap 2023-10-22 12:18:14 +02:00
Rounak Shrestha bd164adf14 Test conversion ts (#5517) 2023-10-22 12:15:44 +02:00
Jeremy 394d29193a Fix another ReDoS vulnerability, turns out this was exploitable too with the same input 2023-10-21 00:52:59 -04:00
Patrick Quist 31af117d68 support new IR Dump header (#5603) 2023-10-15 18:44:27 +02:00
Matt Godbolt a94e10697e Reduce the size of tests for bug #1285 (#5561)
As best I can tell the bug happens due to stuff happening _before_ the
user code. So I have removed anything after the user code (ie the giant
gob of dwarf debug info and symbols), in an attempt to reduce the test
sizes in general.

I manually undid the fix from #1285 and the tests correctly fail with
this reduced input.
2023-10-08 18:11:32 -05:00