Commit Graph
46 Commits
Author SHA1 Message Date
Matt GodboltandClaude c29ad46f3a [Not Live; disabled by default] Add Claude Explain feature for AI-powered assembly explanations (#7749)
Add Claude Explain feature for AI-powered code explanations

This PR introduces Claude Explain, a new feature that provides AI-powered explanations of compiler output directly within Compiler Explorer.

Key features:

Claude Explain functionality:
  - New explain view pane
  - Explains compiler output with full context of source code and compilation output
  - Configurable audience level and explanation type
  - Response caching to improve performance and reduce API calls
  - Usage statistics display showing requests used and token counts

User experience:
  - Consent flow on first use explaining data handling and privacy
  - AI disclaimer banner warning about potential LLM inaccuracies
  - Respects "no-ai" directive in source code for users who don't want AI processing

Privacy and security:
  - Data sent to Anthropic's Claude API as documented in privacy policy
  - No data used for model training
  - Clear consent required before first use
  - Support for opting out via "no-ai" directive

The feature is marked as beta and can be enabled via configuration.

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-05 09:31:48 -05:00
Iain Buclaw 1055430504 Add alias option for gcc tree/rtl viewer (#7985) (#7987)
This option is undocumented, but has been around since 2010 for GCC
4.6.0
2025-08-04 15:44:08 +02:00
Mats Jun Larsen d147341663 Serve all static asset files over the CDN (#7795) 2025-06-28 14:01:36 +02:00
Jeremy Rifkin bb08a6042a Add option for how parents are placed in control flow layout (#7850)
This PR implements this part of the cutter graph layout algorithm:

![image](https://github.com/user-attachments/assets/134e1717-ba24-4e22-bd83-b64b5333fb96)


![image](https://github.com/user-attachments/assets/27c35f4f-73c8-487d-bb2c-cf9ac57787e8)


![image](https://github.com/user-attachments/assets/661a1afe-4e1e-42fd-8b9d-5ca38a2e8a18)
2025-06-22 13:55:53 -05:00
narpfel 93e31a50e1 Add padding in tool output pane (#7802) 2025-06-12 20:29:42 +00:00
Mats Jun Larsen 47e8e6d3a7 Replace href=javascript:; with bootstrap link class (#7797)
Fixes #7792

Bootstrap styles `a:has([href])` as a link so the attribute had been
used in the past for things that aren't actually links, yet we want the
style for. It's better to just use `.link-primary` so it doesn't affect
the contents as discovered in #7792
2025-06-13 02:43:14 +09:00
Abril Rincón Blanco 6ff184857d Fix conformance compiler output title not showing (#7651)
Closes
https://github.com/compiler-explorer/compiler-explorer/issues/7648

In Boostrap 5, `disabled` buttons now have `pointer-events: none`
([Changelog here](https://getbootstrap.com/docs/5.0/migration/#buttons))
which disables the `title` contents popping up.

This PR fixes it by making it a default `badge`, which keeps the same
layout as buttons, but is not clickable by default, much better than
having a `disabled` button never meant to be clicked.

It also slightly changes the padding of the buttons to give them some
breathing space, and fixes a dark background on the pink theme (Found
while testing that all themes worked properly with the `badge`)


![image](https://github.com/user-attachments/assets/a9cb3637-9540-414f-93bd-ef98b7145c7f)
2025-05-12 12:53:43 -05:00
Matt Godbolt f5d8321174 Replace vimeo icon with generic V for vim. Closes #7678 (#7679) 2025-05-12 10:30:37 -05:00
Matt GodboltandClaude 637564f389 Migrate to Bootstrap 5 (#7582)
This PR completes the migration from Bootstrap 4 to Bootstrap 5.3.5
following the plan outlined in
[docs/Bootstrap5Migration.md](https://github.com/compiler-explorer/compiler-explorer/blob/mg/bootstrap5/docs/Bootstrap5Migration.md).

## Migration Process

We followed a phased approach as documented in the migration plan:

1. **Phase 1: Dependency Updates and Basic Setup**
   - Updated Bootstrap from 4.6.2 to 5.3.5
   - Added @popperjs/core dependency (replacing Popper.js)
   - Updated Tom Select theme from bootstrap4 to bootstrap5

2. **Phase 2: Global CSS Class Migration**
   - Updated directional utility classes (ml/mr → ms/me)
- Updated floating utility classes (float-left/right → float-start/end)
   - Updated text alignment classes (text-left/right → text-start/end)

3. **Phase 3: HTML Attribute Updates**
- Updated data attributes to use Bootstrap 5 prefixes (data-bs-toggle,
data-bs-target, etc.)
   - Fixed tab navigation issues

4. **Phase 4: JavaScript API Compatibility Layer**
   - Created bootstrap-utils.ts compatibility layer
- Updated component initialization for modals, dropdowns, popovers, etc.

5. **Phase 5: Component Migration**
- Updated and tested specific components (modals, dropdowns, toasts,
etc.)
   - Fixed styling issues in cards and button groups

6. **Phase 6: Form System Updates**
   - Updated form control classes to Bootstrap 5 standards
   - Updated checkbox/radio markup patterns
   - Simplified input groups

7. **Phase 7: Navbar Structure Updates**
   - Updated navbar structure with container-fluid
   - Fixed responsive behavior

8. **Phase 8: SCSS Variables and Theming**
   - Added custom CSS fixes for navbar alignment
   - Verified theme compatibility

9. **Phase 9: Accessibility Improvements**
   - Updated sr-only to visually-hidden
   - Added proper ARIA attributes
   - Enhanced screen reader support

## Key Changes

- No more jQuery dependency in Bootstrap 5
- New prefix for data attributes (data-bs-*)
- Improved accessibility with ARIA attributes
- Updated positioning classes (start/end instead of left/right)
- Simplified input group structure

## Test Plan

1. **Navigation Testing**
   - Verify all dropdown menus open and close properly
   - Test mobile menu responsiveness
   - Check tab navigation in settings dialog

2. **Component Testing**
- Verify all modals open and close correctly (settings, share,
load/save)
   - Test tooltips and popovers
   - Check form controls in different dialogs

3. **Layout Testing**
   - Test responsiveness on different screen sizes
   - Verify proper alignment of elements
   - Check dark mode compatibility

4. **Specific Features to Test**
   - Compiler selection and options
   - Share dialog functionality
   - Settings dialog
   - Tree view (IDE mode)
   - Font selection dropdown

5. **Browser Testing**
   - Test in Chrome, Firefox, Safari
   - Test in mobile browsers

## Note on Further Improvements

After this migration is stable, we could consider Phase 12: removing
jQuery dependency entirely, as Bootstrap 5 no longer requires it. This
would be a separate effort.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-04-24 12:10:37 -05: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
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
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
Patrick Quist cdb59644cc Add build info for libraries (#6639) 2024-06-29 00:03:09 +02:00
A. Rincón Blanco f63005116f Add a way to filter opt-pipeline passes (#6570) 2024-06-16 11:06:04 +02:00
Ofek f886da7241 Add 'wrap lines' toggle to ir-view (#6595)
Mostly for rust - IR line length there can be legendary.

![irwrap](https://github.com/compiler-explorer/compiler-explorer/assets/73080/1d584ea2-3911-4592-867b-01793425f3e0)
2024-06-12 20:27:44 +03:00
Ofek cf358fb075 Add 'wrap lines' button to opt-view (#6477)
![wrapopt](https://github.com/compiler-explorer/compiler-explorer/assets/73080/bcd63dff-5463-4822-944d-e426165b2987)

I thought I already added it but seems I didn't.
2024-05-14 10:57:51 +03:00
Ofek 1c3b775577 Add simple filters for llvm optimiziation-remarks (#6354)
![optremfilters](https://github.com/compiler-explorer/compiler-explorer/assets/73080/1116998b-de9e-400c-a045-412fd59eb8e3)
2024-04-15 01:05:58 +03: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
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
Jeremy Rifkin b134451b7d Add gimple front-end syntax option for gcc tree/rtl viewer (#5816)
This PR adds an option to the gcc tree/rtl dump viewer to dump syntax
that the gimple frontend can accept


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/4a5ff503-9420-4fc3-ba6f-6b1dc196e938)
2023-11-29 09:42:38 -05:00
Patrick Quist 455d92916a Execution with heaptrack (#5644) 2023-11-07 23:59:40 +01:00
Justin Bogner 4c613e9f70 Implement comment filtering in LlvmIrParser (#5389)
This is arguably a bit pointless, since most if not all of the comments
in LLVM IR are filtered out as part of directives or attributes, but it
comes up for things like `opt` on LLVM IR with debug info and for DXC
(which is DXIL, but that's LLVM 3.7-era IR).

In any case, this makes things less confusing in those cases by making
the comments filter actually do something, rather than be ignored.
2023-08-20 11:32:02 -04:00
Jeremy Rifkin 3716cbd446 Support control flow graphs from the IR pane (#5155)
On top of #5154


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/7bf25b5b-8988-42ff-9d8c-233e6d817997)

Additionally, while I was here, added support for multiple control flow
graphs to be opened from one compiler instead of disabling the button
once one is opened. And improved the implementation for how this was
done for the llvm opt pipeline.

And did some type work along the way.
2023-06-19 21:48:20 -04:00
Guo Ci 7651874a98 add Stack Usage Viewer (#5160)
For #4834
2023-06-19 20:26:15 -05:00
Jeremy Rifkin 8d624b523c Improve CFG viewer navigation and behavior (#5134) 2023-06-11 19:12:09 -04:00
Jeremy Rifkin 60ce06b02f Improve cache handling on the frontend, cache executions on the backend, and improve controls on the exec pane (#5111) 2023-06-11 19:10:30 -04:00
Jeremy Rifkin 10851a1dda LLVM IR pane improvements (#5078)
This PR will add filtering and other output options to the LLVM IR pane


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/ffc865ea-b3fa-441f-b501-4ec4b68e261f)

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/936be326-b55e-40cd-ba47-22b121c1acfb)


Closes #5062
Related to #5045
2023-06-11 17:00:53 -04:00
Patrick Quist 079d495757 Compiler overrides (#5001) 2023-05-16 03:53:57 +02:00
Jeremy RifkinandMatt Godbolt 55dc09017e Compiler Picker UI Improvements (#4849)
Alrighty, round 2!

This PR makes the compiler picker dropdown taller (max height is to the
bottom of the screen)

![image](https://user-images.githubusercontent.com/51220084/224517409-17706ba6-fe85-444a-ad3b-f244f66eea5b.png)

I've added a toolbar button for opening the popout as well as a button
when the dropdown is open:


![image](https://user-images.githubusercontent.com/51220084/224517304-6478fca5-7bc1-4f87-b2ae-e9091d7d48bc.png)

![image](https://user-images.githubusercontent.com/51220084/224517317-83468805-1e9d-4bc6-8a4f-8786325f1e7b.png)

Then the modal interface allows text searching, filtering by compiler
category, and filtering by compiler instruction set. In the future I'd
like to replace the instructionSet property with an architecture
property so the filtering here can be a little better.


![image](https://user-images.githubusercontent.com/51220084/224517348-9cf40866-c5af-4274-84ba-21eb640ab2ea.png)

Demo of the category filtering:


![image](https://user-images.githubusercontent.com/51220084/224517529-5370b3f9-9ad3-4340-838a-b2d0a47c7467.png)

The text filtering highlights results the same as tomselect does:


![image](https://user-images.githubusercontent.com/51220084/224517490-d0dfa6d0-9b61-4be4-8cc7-ca4a4729a532.png)

I moved the favorites permanently to their own column so compilers
aren't jarringly shifted around the screen when favoriting /
unfavoriting.

Also added media queries so the modal looks ok on smaller screens:


![image](https://user-images.githubusercontent.com/51220084/224517563-bdf409c1-7e3a-4c73-812b-f02179b55799.png)


![image](https://user-images.githubusercontent.com/51220084/224517574-07fa2c8b-67d2-496d-9174-b1343e22bd62.png)

I think the only other two changes from the first PR are now the active
compiler is highlighted like it is in the tomselect dropdown and I
figured out how to reliably focus the search bar on modal open. (Oh, and
now clicking a compiler actually does something!)

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-03-12 17:07:44 -04:00
Jeremy RifkinandMatt Godbolt 54fd5b8a24 Show a size estimate for the png export button (#4505)
* Show an estimate for PNG export size

* Prettier ignore a line

* Puggify

Co-authored-by: Matt Godbolt <matt@godbolt.org>

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2022-12-28 10:18:26 -07:00
Jeremy Rifkin 00b3a8ab23 Implemented png export (#4427) 2022-12-12 20:10:08 -06:00
Jeremy Rifkin 10ba9a10cd Add svg exports for cfgs (#4424)
* Added svg exports for cfgs

* Quick refactor

* Fix background colorfor chrome exports
2022-12-12 18:22:26 -05:00
Jeremy Rifkin 1294c3f949 Control flow graph tool rework (#3899)
* Removed old code

* Base functionality

* Work on edge offsets

* Setup interval trees for edges

* linter things

* Formatting

* Added syntax highlighting

* Cleanup and simplification. Improved handling of direct dropdown edges.

* Basic zoom/pan

* Remove old blocks from output

* Fix distance calculation

* Added function selector

* Improved zoom behavior

* figue 8 logic

* Canvas scaling / repainting, updated colors

* Don't truncate output, also removed some console.logs

* Tweak to zoom system

* Replaced canvas stuff with svg

* Experimenting with adding shadows to edges

* Removed shadows, was causing problems. Improved how blocks with lots of incident edges are handled.

* Slightly improved edge system

* some work on implementing segment priority system from cutter

* Optimization to rendering process. I was worried the graph layout algorithm was causing the page to hang but it turns out it was adding elements to the page with +=

* Removed need for storing the previous segment

* refactor, splitting up some logic

* Cleaned up logic and got horizontal edges working better

* Remove vis-network dependency

* Updated package-lock, removed @import vis-network css stuff, added a todo for myself

* Cleaned up notes and error messages. Added comments. Clear the pane if there's no function to display

* Added layout time information, implemented .resize

* Light theme

* State work and bug fix for dragiing

* Re-dading lost dark theme changes

* Added jquery import

* Cleaned up console.logs

* Added basic block count

* Incorporated PR review comments; Fixed cypress (hopefully), added documentation, improved the dropdown, and fixed dropdown items not being cleared with an empty result.cfg

* Ran format
2022-11-29 22:28:10 -05:00
Patrick Quist 750f1930a7 File drop support (#4247) 2022-11-12 15:14:51 +01:00
Rubén Rincón Blanco c7cfda6a3f Add language tooltips (#4237) 2022-11-09 02:53:04 +01:00
Ofek db9b4f48b0 Add Hide metadata option to LLVM pipeline (#4243) 2022-11-06 12:22:47 -05:00
Rubén Rincón Blanco 460eda11ee Add license info button to compilers (#4077)
* Add a way to show compiler license infos

* Add example for x86 clang
2022-09-20 08:00:42 -05:00
Rubén Rincón Blanco 8d6f171197 Cypress test to open all panes (#3953) 2022-09-04 17:31:36 +02:00
Rubén Rincón BlancoandJeremy Rifkin 4ba8a1d121 Move LLVM opt pipeline filters to their own dropdown (#4000)
Co-authored-by: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com>
2022-08-30 12:46:07 +02:00
J. Ryan Stinnett 44aa191cad Add debug info filter option to LLVM opt pipeline viewer (#3987)
* Add debug info filter option to LLVM opt pipeline viewer

* Add MIR debug info pseudo-instructions to filters

* Use mixin for LLVM opt pipeline options

This fixes a few templating errors from the more verbose version.

* Add name to contributors

* Generalise dbg call filter
2022-08-24 20:16:48 -04:00
Max Coplan a3327d8ba1 ✏️ [UI] Fix small UI typo (#3976) 2022-08-20 11:24:47 +02:00
Rubén Rincón Blanco 7f7ca77fb2 Adds icon to Select all and makes the text hideable (#3970) 2022-08-19 09:13:49 +02:00
Rubén Rincón Blanco 5b84b23b30 Fix small UI problems (#3948) 2022-08-09 22:13:50 -05:00
Fred TingaudandRubén Rincón Blanco ea3b66df11 Add possibility for tools to generate an artifact (#3893)
* Add possibility for tools to generate an artifact

* Add button to download the artifact instead of downloading it automatically.

* Add better description on artifact button.

* Apply recommendations

* Update static/panes/tool.js

Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>

* Use a download icon rather than save

* Introduce correct type for artifact.

Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
2022-07-28 09:57:03 -05:00
Rubén Rincón Blanco 712814f6b5 Adds way to disable executor recompilation on parameter change (#3862)
* Adds way to disable executor recompilation on parameter change

Now that this is here, maybe another toggle for tools would also be good
to have. Maybe even for the compiler itself.

And if we go that route, why not 1 for all three kind of panes?

Closes #3783

* Address PR reviews

Sometimes I wonder why I don't think of this things myself :)

* Do the state saving always
2022-07-18 14:18:22 +02:00
Rubén Rincón Blanco a4565fb352 Updates some Pug files (#3842)
* Move popup views to their own file each

* Make simple monacopane mixin in templates

* Also extract templates to their files

Compiler got some mixin love too :)

* Also split templates to their own files

* More mixin love for more files
2022-07-10 17:43:28 +02:00