2218 Commits
Author SHA1 Message Date
Ofek 47a2493c82 Fix #5464 (#5654)
Nothing fancy, just 2 more special cases for multi-line IR instructions.
2023-10-30 20:36:35 -05: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
Steve 2f0b8028c7 Always get version string for dotnet (#5648) 2023-10-30 16:23:54 +01:00
Steve 9daa1a9447 Fix crossgen2 compilation (#5661) 2023-10-30 16:19:04 +01:00
Patrick Quist 7975602953 Dont attempt to demangle (llvm-ir) if we cant (#5666) 2023-10-28 16:32:19 +02:00
Patrick Quist 49252efa92 Execution hotfix (#5659) 2023-10-26 20:46:32 +02:00
Ofek ca7447e185 Fix #5621 (#5637)
I opted to suggest as minor a change as possible, and just special-cased
these `.omp_outlined.` functions (their name can contain an index) in
two places. This is enough to solve the confusing IR/ASM cfg diff, and
have asm separate functions properly.
2023-10-24 15:27:57 -04:00
Ofek f1c562395e Another fix on the way to resolving #5617 (#5646)
Turns out `ArmInstructionSetInfo.unconditionalJumps` and
`ArmInstructionSetInfo.conditionalJumps` are not disjoint, and the order
in which they are tested matters. Specifically an opcode like `b.lt`
provides a match for `ArmInstructionSetInfo.unconditionalJumps` in the
single char `b` and so erroneously returned `InstructionType.jmp`.

One can imagine a better solution in modifying the regexes to make them
properly disjoint, but AFAICT this is good enough, at least to un-break
the ARM CFG.
2023-10-24 15:27:06 -04:00
partouf c6c2404b94 more types 2023-10-24 17:35:50 +02:00
partouf 5ef2fb1025 add types 2023-10-24 17:30:36 +02:00
partouf b93fdb3ca3 fix types 2023-10-24 17:24:07 +02:00
partouf 0ead74ec8a formatting 2023-10-24 17:18:59 +02:00
David Spickett 5f3db78dce Add the LLVM TableGen language (#5629)
LLVM TableGen is used to generate complex output files in the llvm
project. A generic description of classes and definitions produces
"records" that can then be walked by a TableGen backend to produce
things like C++ code, configuration files, etc.

The biggest examples are LLVM's assembler and disassembler where all the
targets' instructions are defined in TableGen.

https://llvm.org/docs/TableGen/ProgRef.html

An example:
```
class Register<int _size, string _alias=""> {
    int size = _size;
    string alias = _alias;
}
def X0: Register<8> {}
def X29: Register<8, "frame pointer"> {}
```
```
------------- Classes -----------------
class Register<int Register:_size = ?, string Register:_alias = ""> {
  int size = Register:_size;
  string alias = Register:_alias;
}
------------- Defs -----------------
def X0 {        // Register
  int size = 8;
  string alias = "";
}
def X29 {       // Register
  int size = 8;
  string alias = "frame pointer";
}
```

It's often a pain point for people new to LLVM so having a quick way to
experiment would be a great benefit for the community (we have a Jupyter
kernel which is good but not as simple as Compiler Explorer).

The compiler for TableGen is `llvm-tblgen`. This comes with most release
builds of LLVM in /bin along with clang and the others. Its default is
to output a text dump of the records defined so that's what I've used
here. This is not executable code so I've disabled the features related
to that.

A user could pass options to `llvm-tblgen` to produce text in a format
other than this, C++ code or JSON for example. However this text dump is
the main use case.

I've re-used an existing clang install, since that includes
`llvm-tblgen` in `bin/`. I just added the 17.01 version for this first
change.

Syntax highlighting is a mix of the Fortran and Ada configuration,
following the language spec I linked above. Though I am very new to that
so it is likely incomplete.
2023-10-23 19:59:46 -05:00
Steve c5ffd00598 Allow disabling diffable asm manually (#5585)
When we see JitDisasmDiffable being set manually, we can stop
automatically emitting JitDisasmDiffable.
2023-10-23 19:53:09 -05:00
Cassandra Beckley d23bbc6596 Add AST viewer support for HLSL/DXC (#5627)
<!-- 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!
-->
Since DXC is a fork of Clang from LLVM 3.7, the AST can be generated and
parsed in a manner similar to the Clang AST.
2023-10-22 12:17:24 +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
Jeremy 6f6bc6aa35 Fix ReDoS vulnerability in the z88dk assembly parser, regex was exploitable with relatively short inputs and could be used to freeze a node for extended periods of time 2023-10-20 23:15:15 -04:00
Matt Godbolt 37ce1f56ed Fix test 2023-10-19 08:09:30 -05:00
Matt Godbolt 18b0b8edd3 Thank you @partouf...I spend too much time doing python these days... 2023-10-19 07:52:02 -05:00
Matt GodboltandNick DeMarco 458fa247f8 Hylo fixes; specify PATH, and fix name (#5625)
-  Add a general extraPaths for compilers and use it to let Hylo find clang++

Co-authored-by: Nick DeMarco <nickpdemarco@gmail.com>
2023-10-18 21:59:42 -05:00
Matt Godbolt c115a45ecb Final fixups to get Hylo execution and binary working 2023-10-18 15:54:55 -05:00
nickpdemarco 5e1b320ee2 Update path from main 2023-10-18 16:40:25 -04:00
nickpdemarco 4fd7f325f4 merge main 2023-10-18 16:36:52 -04:00
nickpdemarco a0cb7f11ae Get execution working by setting library paths to [], be more precise about when we emit intel 2023-10-18 16:34:27 -04:00
Ofek 82b4d0fa58 Fix #5617 (#5620) 2023-10-18 14:03:11 -05:00
Nick DeMarco 58ee2354be Add Hylo support (#5622)
This PR adds front end support for the
[Hylo](https://www.hylo-lang.org/) programming language. Back end
support has already been added with
https://github.com/compiler-explorer/misc-builder/pull/71 and
https://github.com/compiler-explorer/misc-builder/pull/72.
2023-10-18 12:07:38 -05:00
nickpdemarco d72be292d8 Remove old svg, comment 2023-10-18 10:28:22 -04:00
Quinton Miller 36018ff3dd Fix Crystal assembly and LLVM IR output on 1.9+ (#5610)
Crystal 1.9+ has made the `.s` and `.ll` files follow the base name of
the output rather than the input (I think this is due to
crystal-lang/crystal#13370), this PR matches the Crystal compiler's
behavior
2023-10-17 13:52:31 +02:00
Patrick Quist 31af117d68 support new IR Dump header (#5603) 2023-10-15 18:44:27 +02:00
Patrick Quist 4481bd0f3a Show up to date version for trunk compilers (#5571) 2023-10-15 15:56:43 +02:00
nickpdemarco 1b136ae688 Add note to add LLVM IR view later 2023-10-11 15:50:29 -04:00
nickpdemarco 4ee6cda52f rename val to hylo 2023-10-11 15:01:45 -04:00
nickpdemarco 9cda199e40 Merge main, resolve conflicts with vala 2023-10-11 14:43:05 -04:00
Matt Godbolt 1fc878d7a2 Bump all the things forward (#5563)
also run the lint and format nonsense
2023-10-05 21:43:33 -05:00
fghzxm 0989427c12 asm-parser: Recognize more dataDefn directives (#5535)
This patch adds more data definition directives to be recognized by
`AsmParser` in lib/parsers/asm-parser.ts.

Fixes #5489, as well as inappropriate filtering of `.double` directives
in test/filter-cases/diab.asm which is similar to #5489.

The list of data directives are taken from the "Assembler Directives"
chapter of the [GNU `as` manual][as]. Directives added by this patch
are:

- `.dc[size]`
- `.dcb[size]`
- `.ds[size]`
- `.double`
- `.fill`
- `.float`
- `.int`
- `.single`
- `.skip`
- `.space`
- `.string8`, `.string16`, `.string32`, `.string64`

The `.space` directive is not a data directive when assembling for the
HPPA architecture; this must be fixed if HPPA support is to be added to
Compiler Explorer.

Some of the directives such as `.string64` are pretty unlikely to be
emitted by actual compilers, but we add them because it can't break
existing input (no `as`-compatible compiler can use them as non-data
directives), and will futureproof us against future compilers that do
emit them.

Architecture-specific directives documented in the "Machine Dependent
Features" chapter are not added in this patch, even though it may be
better to add some of them (such as `.stringz`) as well. Existing
directives that are not found on the "Assembler Directives" list are not
removed.

`.sleb128` and `.uleb128` are technically data directives, but aren't
added because we assume they're only used in debuginfo.

[as]: https://sourceware.org/binutils/docs-2.41/as/index.html

<!-- 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!
-->
2023-10-05 07:32:04 -05:00
partouf 4ee4f7646c make rpath flag easier overridable in compiler class 2023-09-24 00:40:10 +02:00
Simon Sobisch 634f9a13ae GnuCOBOL: always pass -g to the C compiler (#5504)
As this is done with other compilers like C/C++ and doesn't add extra
code (like plain `-g` would).

(this supersedes the broken #5503)
2023-09-23 08:53:14 +02:00
Prabhat Sachdeva cc33ad1a4e Add mode with no syntax highlighting to monaco editor. (#5490)
If `languageId` is not defined, the syntax highlighting in the Monaco
editor panel defaults to **ASM**.
This pull request creates a `no-highlight-mode` with **no syntax
highlighting**. This mode can be used when the syntax highlighting is
not required.

In this PR I've also updated the result of Carbon Language to use this
`no-highlight-mode` as the **ASM** syntax highlighting wasn't matching
the execution trace of Carbon Explorer.
2023-09-22 09:54:41 -04:00
Jeremy Rifkin fb147126e8 Fix WSL for systems that don't have windows paths (#5480)
Attempt to fix #5476. As far as I can tell `process.env.winTmp` is
needed just for windows executables and WslVcCompiler. It should be
possible to just ignore the exec error and continue. If for some reason
the user doesn't have windows paths in their WSL but does want to run
windows executables they can pass `-tmpDir`.
2023-09-16 15:59:26 -04:00
Justin Bogner 6a5a78f3b8 Introduce ClangDxcCompiler for HLSL (#5388) 2023-09-04 14:14:18 +02:00
partouf fae2f3628b fix 2023-09-04 14:04:07 +02:00
Cassandra Beckley 92a41e3468 Improve SPIR-V parser (#5441) 2023-09-04 14:02:31 +02:00
partouf effea73b0a include languageid in result 2023-09-04 14:00:37 +02:00
Cassandra Beckley 94dae50be0 Use the SPIR-V parser for DXC SPIR-V output (#5418) 2023-09-04 13:59:52 +02:00
Matt Godbolt ef8e591cb0 Merge branch 'main' into edg-support 2023-09-03 12:49:28 -05:00
Jeremy Rifkin 63ac0a3308 Also specify MSAN_SYMBOLIZER_PATH for clang (#5424) 2023-08-27 11:27:21 -04:00
Matt Godbolt 6173492723 Merge branch 'main' into edg-support 2023-08-25 12:59:53 -05:00
Steve 58697ccf38 Improve the disassembly format for dotnet (#5419)
This is an improvement that can improve the disassembly format to make
it more friendly to a diff checker.

All versions tested:

net6.0:

![image](https://github.com/compiler-explorer/compiler-explorer/assets/14960345/1ae4fda5-db73-4703-88f9-abd640b4e5e1)

net7.0:

![image](https://github.com/compiler-explorer/compiler-explorer/assets/14960345/6dfe1a74-a09a-40c4-b586-425b8ee84b12)

trunk:

![image](https://github.com/compiler-explorer/compiler-explorer/assets/14960345/36247f19-1e26-4bb8-ab1d-040d7145854f)
2023-08-25 06:48:18 -05:00
Steve 6601a41423 Bring back crossgen2 (#5415)
It turns out we still need crossgen2 for net6.0.
So bring crossgen2 back for net6.0 only.

Also fix some bugs around `indexOf`.

No image rebuilding is required.
2023-08-24 19:23:53 -05:00
Steve 564ffed567 Use corerun and DisassemblyLoader for dotnet (#5391)
Depends on https://github.com/compiler-explorer/dotnet-builder/pull/4

- Use corerun instead of crossgen2 to do disassemble
- This can skip emitting actual executable by crossgen2 and speed up the
compilation
- Filter disasm to only show disasm for user code

We need to rebuild images for old compilers.
2023-08-23 11:03:36 -05:00