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.
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.
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.
<!-- 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.
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
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!
-->
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.
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`.
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.
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.