Commit Graph
2547 Commits
Author SHA1 Message Date
Marc Auberer 2d4a8d59fa Fix function define regex in pass dump parser (#7330)
Function in LLVM IR can also contain `-` characters without being
enquoted.
2025-01-29 11:30:16 -06:00
Mats Jun Larsen bcd6394435 Ensure that content type for formatting requests is JSON (#7327)
Ideally I'd add a middleware or something else that requires JSON, but I
suppose this is fine for now.

cc @dkm
2025-01-29 10:46:56 -06:00
Waqar Ahmed 54ea096e1a odin: require main function (#7314)
In optimized build, odin inlines the world and even ends up inlining the
user visible `main` function into the entry point main. The result is
empty asm output which is confusing. Thus, @require main so that the
compiler doesn't inline user visible main function

 #7210
2025-01-29 10:41:03 -06:00
Matt Godbolt ed825b8aa2 Some tidying up of the asm parser code (#7329)
- use `Set` and `Map`
- reflow comments
- remove redundant `!!`
- rephrase iterative "follow the chain of weak symbols" to be recursive,
removing artificial limit.
2025-01-29 10:29:06 -06:00
Waqar Ahmed 650e706c4d Unset context.prevLabel when a label gets filtered (#7315)
Otherwise subsequent unused label's directives end up being included in
the processed asm even though the label itself got filtered
2025-01-29 08:40:07 -06:00
Matt Godbolt f1e930b7fc Decommision the "AWS" magic compiler name (#7321)
Nothing was using it, we're using other methods these days to discover
remote compilers (and have been for years), and it was broken (see
#1790).

Also cleans up some config (moving it from aws to ceProps; though it was
unused, default used only), and also some workarounds for remote
compilers that refer back to the MS compiler era (#1768).

This leaves the ability in `aws.ts` to fetch instances in case we ever
need the functionality, as this is tested and still works.

Closes #1790
2025-01-29 08:36:01 -06:00
kevinjeon-g 44920dd00d Fix .smali class regex in Dex2OatCompiler (#7319) 2025-01-29 09:36:11 +00:00
Matt Godbolt 3b507a6db3 Handle ARM's .set usage (#7322)
Treats `.set` as an "alias" for the set of labels referred to, and
doesn't filter alias-creating `.set` in used paths even if directive
filtering is on. Only works for `.set <something>, .` with an optional
`+ 0`.

Also changes a silly loop that was looping N times doing the same thing
if `inFunction && isDataDefinition`, though quite possibly that's broken
in a different way. No tests changed, anyway.

Adds a new test for the new behaviour.

Closes #1799
2025-01-29 10:07:43 +02:00
Matt Godbolt e452db56fc Special casing for msp430 (#7317)
- Make a special msp430 handler that breaks lines on `{` to fix the
weird inlining behaviour unique to msp430 output.

Closes #295
2025-01-28 10:00:04 -06:00
Patrick Quist 7234169c86 Attempt to fix remote library fetching (#7303)
Libraries were being fetched from wrong URL (on startup);
`Fetching remote libraries from
https://godbolt.org:443/api/libraries/c++`

Ended up refactoring a bunch of things to get some unittesting going on

I did not test actual startup and compilation with CE, I might have
broken something. (but @mattgodbolt tested and it looked great)
2025-01-25 09:27:03 -06:00
Filippo Barbari a53090ec92 Added check for clang-offload-bundler for Intel OneAPI >= 2024.0.0 (#7278)
Fixes #7277.
2025-01-24 11:22:03 -06:00
kevinjeon-g e4fc6cb001 Fix dex2oat on Android Kotlin (#7292)
The Kotlin compilation step results in an added 'final' in the D8 .smali
output, which we weren't accounting for. This change updates the class
name regex for .smali files to collect only the 'L<class>;' string.

This change also fixes dex2oat for Android Java in cases where 'final'
is applied to classes.
2025-01-24 17:36:23 +09:00
Andrea Tomasi ee4ab8bb5b View Elixir jitted assembly (#7282)
Hi, this PR adds a way to view the assembly code of Elixir code.

This continue the work from #6081 and #6104
2025-01-19 11:34:32 +09:00
Matt Godbolt b6ead25038 Support .base64 as a data indicator. (#7281)
Fixes #7280

@partouf I expect this will need a fix in the C++ code too, right?
2025-01-16 15:58:05 -06:00
Matt Godbolt 8ef76dd5bf Support execution and binary output in ispc (#7273)
- ispc doesn't link, so interpose running `gcc` or similar to output the final binary
- works around some naming issues in ispc

Ckoses #3937
2025-01-16 14:06:35 -06: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
Ofek a101e2d9f2 Fix MSVC's handling of /link options, fix and modernize some docs (#7260)
<!-- 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!
-->
2025-01-11 18:16:04 +02:00
Matt Godbolt b26aba77bf Handle sponsor cases with items that need to be shown every time better (#7257)
Look at the error if the item was chosen instead of the current error.
2025-01-09 19:21:49 -06:00
kevinjeon-g fd6a07d233 Add source<>disassembly highlighting for dex2oat (#7248)
oatdump, the dex2oat dump tool, doesn't output any information that can
be used to associate disassembly with source lines. However, dex2oat's
output optimization CFG (classes.cfg) does contain a final disassembly
stage that retains dex_pc.

Lines of disassembly from oatdump can be associated with lines of
disassembly in classes.cfg, and through the dex_pcs there, be mapped
back to the D8 .smali output, which does contain source line
information.
2025-01-08 11:17:17 -06:00
Waqar Ahmed e0e2420482 Improve odin codegen processing (#7228)
- Builtin runtime functions __$startup_runtime, __$cleanup_runtime, __$*
are now filtered out
- Label matching regex is fixed for odin, see OdinAsmParser class. This
ensures we filter out all labels that don't belong to the current file
- Slightly improved editor support, auto bracket closing and commenting
via keyboard shortcuts works now
- procedures within the file are automatically @require as requested by
GingerBill (odin lang creator).

There still are a lot of unused labels with data definitions that dont
get filtered out.

#7210
2025-01-06 15:49:15 -06:00
kevinjeon-g 79028a0610 Support kotlinc output for Android Kotlin (#7251)
This change adds kotlinc as an output option for Android Kotlin, and
updates kotlin.ts to allow for input libraries by parsing library paths
and passing them in with '-cp path:path:...'.

This is intended to simplify the process of inspecting kotlinc output
when Android Kotlin is already selected so that a user doesn't have to
switch to the Kotlin compiler option. This also allows a user to view
kotlinc output with Android libraries.

<!-- 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!
-->
2025-01-06 15:46:54 -06:00
Ofek b97cbb33b9 Fix #7237: account for potential warning/error matches (#7238)
A warning in an old gcc (4.8.1) had a format that was accidentally
caught by the -fopt-info regex. Now accounting for potential
errors/warnings caught accidentally.

I don't like that `processOptOutput` is being called regardless of
whether `backendOptions.produceOptInfo` is set, maybe need to address it
too.
2024-12-22 11:54:29 +02:00
kevinjeon-g 5e23a935de Add full oatdump output behind filters (#7233)
This change makes full oatdump output visible behind the "Directives"
filter. This does the same thing as the --full-output flag, but is
more-easily used. The default code snippets have been updated to include
this.
2024-12-20 11:58:18 -06:00
Ofek 97b5735c21 Opt-remarks for gcc (#7230)
![gccoptrem](https://github.com/user-attachments/assets/4662c5d1-3a4e-443b-a989-bc4dc109e90b)
2024-12-20 10:19:33 +02:00
Matt Godbolt e18ada50fa Add support for QNX (#7234)
CC @doodspav
2024-12-19 16:32:13 -06:00
Partouf 64f3ae4636 fix incompatible options 2024-12-16 15:31:45 +01:00
Ofek 50a7f3ebbf Set MSVC default option to /utf-8, remove it if the user specified /source-charset or /execution-charset (#7223) 2024-12-16 13:42:16 +01:00
Steve d37e1f458a .NET: Add cross-arch codegen support for crossgen2 (#7215)
This allows users to inspect the disassembly other than x64.
2024-12-13 04:32:31 -06:00
Spencer Fricke 120e16aa59 Fix error lines for GLSL output (#7207)
glslang outputs its message strangely (and it is not going to change,
otherwise I would have made the changes there)

This will take an ouptut like

```
ERROR: <source>:4: Something bad
WARNING: <source>:5: Something less bad
```

to be

```
<source>:4: Something bad
<source>:5: warning: Something less bad
```

so it appears automatically in the UI


![image](https://github.com/user-attachments/assets/05454b10-abf7-4f81-8f26-17970028f3f8)
2024-12-09 08:06:02 -06:00
Waqar Ahmed d7f92bdb59 Improve odin codegen processing (#7204)
- support library code filter
- disable demangling, its not needed for odin
- support LLVM IR

<!-- 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-12-09 12:14:40 +09:00
Matt Godbolt 02951a20db Unify types for tool args (#7199)
- Uses strings across the board in the UI part (no functional change
here from before; all state is the same as it was before).
- Sends _arrays_ in the POST, using the same `splitArguments` code as
the backend.
- Backend _still supports_ strings (though doesn't advertise), also
using same `splitArguments`.
- Moves `splitArguments` into common utils, and rephrases to avoid
unnecessary use of underscore and ES2021+ code.

Tested locally:
- with both old and new client code (ran new backend and old webcode to
show sending strings still works)
- with creating and removing tool windows (checked with `ldd` locally)
- with various strings on the client `moo foo "this is bad" #moo` and
even "error" things like `this is "badger` (with a missing close quote).
All works as you'd expect

Happy to break the "move the splitArguments" code into a separate PR if
that'd be easier to review separately.

Fixes #7195
2024-12-07 14:44:42 -06:00
Mats Jun Larsen c256b922f7 Migrate site templates to yaml config (#7189)
Does some winter cleaning on the site-template stuff :)

1. Migrated away from the custom conf format to plain old yaml
2. Made the images and image files match with the name from the yaml
file. (It's not a problem to have spaces in file paths, nor urls so I
don't see why we shouldn't)
3. Updated the relevant documentation

There is a small breakage in the api response for the meta field. It now
returns `{"screenshot_dimensions":{"width":1000,"height":800}}` which I
believe is a lot more useful than
`{"meta.screenshot_dimensions":"1000x800"}`

Besides, I don't believe this endpoint has any third-party consumers
that rely on the metadata since it's a rarely known feature anyways
2024-12-08 00:59:58 +09:00
Mats Larsen 0d7d5dfc43 Remove unused body-parser dependency 2024-12-07 01:50:28 +09:00
Atharva Rai a3c64dc4dc Remove body-parser dependency (#7176)
This PR addresses issue #7158 by removing the body-parser dependency in
favor of express.json() and other built-in middleware functionalities
provided by Express.js.
2024-12-07 01:47:06 +09:00
Partouf 3aff85a216 odin fixes 2024-12-06 17:29:16 +01:00
Waqar Ahmed d3ef2de208 Add Odin language (#7186) 2024-12-06 17:28:47 +01:00
Steve 77bbd0b6dc Make the argument parsing more robust (#7185)
Instead of skipping the exactly the last option, skip all options after
the input filename.

Otherwise, in some cases there can be options like `-Wl` and etc. being
passed to the compiler and cause build failures.
2024-12-05 08:13:28 -06:00
Mats Jun Larsen 6566759c75 Hotfix static max age header (#7182)
Good catch @mattgodbolt
2024-12-04 08:13:22 -06:00
Spencer Fricke 05f86a38dd Add preliminary Slang support (#7151)
Part of
https://github.com/compiler-explorer/compiler-explorer/issues/2331 and
similar to [my GLSL
change](https://github.com/compiler-explorer/compiler-explorer/pull/6883)

[Slang](https://shader-slang.com/) is a GPU focused shading language
that has been worked on for years. Last week [The Khronos
Group](https://www.khronos.org/news/press/khronos-group-launches-slang-initiative-hosting-open-source-compiler-contributed-by-nvidia)
will now be running the project as open governance. The latest [Vulkan
SDK](https://www.lunarg.com/lunarg-releases-vulkan-sdk-1-3-296-0-for-windows-linux-macos/)
has also added a build of `Slangc` (slang compiler).

This change adds support for Slang (the language) as a front end with
`Slangc` (the compiler) as the only compiler. Slang can be used for
things like GLSL/HLSL, but that is for a future PR.

I am in contacts with people on the Slang development and plan to
support things for Slang as well as the other GPU related shading
languages

--- 

of course, screen shots as well


![image](https://github.com/user-attachments/assets/c9f6460b-b779-4ff5-b0bb-5a7eff543de1)


![image](https://github.com/user-attachments/assets/b2dbdd5a-c031-4110-ab9d-ed76b9881ad8)
2024-12-04 04:45:50 -06:00
kevinjeon-g 6296e9064d Support OpenJDK output for Android Java (#7122)
This change adds OpenJDK as an output compiler for Android Java,
beginning with 11.0.2. This change also updates java.ts to allow for
input libraries, by parsing library paths and passing them into the
javac invocation as '-cp \<path\>:\<path\>:...'.

This is intended to simplify the process of inspecting javac output when
Android Java is already selected so that a user doesn't have to switch
to the Java compiler option. This also allows a user to view javac
output with Android libraries.
2024-12-04 19:11:11 +09:00
Matt Godbolt 2dd0704dc6 Add a sleep util (#7172) 2024-12-02 18:22:14 +01: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
Steve 13eabd6d04 .NET: Fix the redundant options in some cases (#7152)
#7143 accidentally broke the compilation for mono as it would pass an
unnecessary option `--parallalism 1` to `mono`. Missed this in my local
test as the result of mono was cached.
This option is only used by Crossgen2 and NativeAOT.
2024-12-01 02:58:45 -06:00
Mats Jun Larsen 630015c3f3 Remove addStaticHeaders and contentPolicyHeader functions (#7159)
Stops passing these functions around and instead configures the headers
by chaining express handlers
2024-12-01 16:22:41 +09:00
Mats Jun Larsen fba4ba672a De-couple formatter from http server (#7155)
This patch decouples the formatting logic (which is used by the
clang-format feature) from the http API logic.

This is done with the new FormattingService populates the formatters
from the config, and wraps formatter execution. This way, both the http
controller and the clang-format functionality can use it, reducing tight
coupling.
2024-11-30 12:14:11 +09:00
Mats Jun Larsen 09adb2795a Add re-usable middleware functions to http server (#7154)
Just add the headers you want to the handler list :)

It's basically the addStaticHeaders function again, but this time more
composable. End goal is to replace that function and all its uses with
this as I go with the api improvements

This technically also fixes a cors regression from earlier patches
2024-11-30 11:37:57 +09:00
Steve 1e02873328 Remove the restrictions on compiler options (#7143)
Follow up to #7141

As per
https://github.com/compiler-explorer/compiler-explorer/pull/7141#issuecomment-2506116434,
remove the restrictions on compiler options.

cc: @junlarsen
2024-11-28 15:52:14 -06:00
Matt Godbolt 6fa1dede79 Add lfortran and a slightly hacky path to clang (#7149)
Advice sought: I didn't want to plumb through a whole new compiler flag
for `clang` so used a top-level one for `fortran` in the form of a
`ceProp` (which doesn't cascade through all the groups etc). I think
this is _ok_ but ugly and surprising (To me...) and I wonder if we
should actually consider making each compiler's `ceProps` use the same
logic as the logic in the discovery process with parent properties
etc...or not. (cc @partouf in case I've missed something obvious!)
2024-11-28 15:51:51 -06:00
Thirumalai Shaktivel d5ccd7cf20 [feat] Add LFortran as a new fortran compiler (#7119)
Details:
LFortran is a modern open-source (BSD licensed) interactive Fortran
compiler built on top of LLVM. See, https://lfortran.org for more
details.
 There was an interest in the community to add the compiler into the 
 Compiler Explorer: https://github.com/lfortran/lfortran/issues/623. 
 So, this PR adds it.

LFortran is in alpha (the source code compiles to binary and execute. 
 But, users are expected that their code can break). It can emits AST, 
 ASR, LLVM, C, C++, WAT, Julia, Fortran, etc. It has multiple backend
 like LLVM (default), C, C++, x86, WASM, fortran and mlir. 
 For more options run `--help`.

Changes in this PR:
- Add LFortran as a new Fortran compiler.
- `-g` options is enabled by default in `optionsForFilter`. Providing an
option
to disabling it helps other compilers (that doesn't have complete
support for
 debug information) to compile successfully
2024-11-28 10:45:01 -06:00
Mats Jun Larsen 0c51a94d14 Move site-templates loader file (#7146)
File doesn't have anything to do with the http server anymore
2024-11-29 01:18:21 +09:00