https://llvm.org/docs/CommandGuide/llvm-dwarfdump.html
This dumps the DWARF debugging information in a human readable form:
```
<source>: file format ELF64-x86-64
.debug_info contents:
0x00000000: Compile Unit: length = 0x00000063 version = 0x0004 abbr_offset = ...
0x0000000b: DW_TAG_compile_unit
DW_AT_producer ("GNU C17 9.4.0 ...)
```
This tool would be useful to have when comparing the debug output of two
compiler versions or compiler targets. For instance I wanted to find out
recently how AArch64 and X86 targets represent TLS variables.
The tool runs on the compiled binary, so is post compilation. If the
binary
has no debug information the tool does not crash, it just tells you that
there is no information.
To fit the other llvm/clang tools, I've just added an "llvm-dwarfdump
(trunk)"
like llvm-mca has done. Added it to c/c++/objc/objc++ (open CL can't
compile
to binary so skipped those). MSVC is excluded because it produces PDB
files
instead.
The tool works for at least ELF and XCOFF files, I haven't been able to
test
any others.
~0.5Y ago I tried to raise a local CE instance to experiment with an
in-house clang plugin. This eventually succeeded but only after much
grief and eventually an [advice from
partouf](https://discord.com/channels/763778740345765900/764131312117743656/1108408691746680842).
The conjecture raised at that Discord thread was that the
`optionsForbiddenRe` property was devised circa 2015 to block plugin
usage (and others) as these were considered an attack surface. If that
is the case - this is no longer true since using nsjail.
LLVM-MCA is supported for X86-64 clang compilers, but not for armv8-a
clang. This enables LLVM-MCA support for AArch64 because it is supported
for many AArch64 cores.
Fixes request #5649.
Since trunk will be a moving target, I've left the default compiler as
17.01.
The standard include path will allow for examples that include files
like `include "llvm/TableGen/SearchableTable.td"`, without extra
options. This is useful if you want to create a minimal example of the
records that an existing backend expects to see.
This change fixes the include paths for libbpf.
Tested on a local install. I think in the original PR I had libbpf
headers on the system and were being picked up.

The same code fails in the current version:
```
// Type your code here, or load an example.
#include <lib/libbpf.h>
int square(int num) {
return libbpf_major_version();
}
```
Error:
```
<source>:2:10: fatal error: 'lib/libbpf.h' file not found
#include <lib/libbpf.h>
^~~~~~~~~~~~~~
1 error generated.
ASM generation compiler returned: 1
<source>:2:10: fatal error: 'lib/libbpf.h' file not found
#include <lib/libbpf.h>
^~~~~~~~~~~~~~
1 error generated.
Execution build compiler returned: 1
```
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
The existing seastar version 1808 is more than five years old and lots
of exciting changes have occurred since then. This patch adds seastar
2211 from last last year as well as trunk.
The 2211 version of seastar requires PR compiler-explorer/infra#1134 to
be accepted first to add it on the infra side.
`make check` passes.
Fixes#5641
The "all architectural features" compiler is trunk, plus a whole bunch
of `-march` flags to enable the kitchen sink for AArch64. Which is
useful for some, but as pointed out in the issue, not representative of
what the average clang on the average system will produce. So plain
trunk is a better first entry for this category.
To fix this, I've changed the semver value so that we will have this
order:
```
(trunk)
(all architectural features, trunk)
17.0.1
<more versions...>
```
`(trunk)` is not treated as a valid semver so it's sorted by the string
value. So the shorter `(trunk)` was shown before the longer `(trunk,
all...`.
This is why the other special compiler versions sort as they do, because
they are `(` then something < `t` (and I didn't find any special
workarounds either).
Putting `trunk` at the end fixes this issue and will not break existing
URLs since the name of the compiler settings file entry (e.g.
`armv8-full-clang-trunk` for C++) has not changed.
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.
`rustc` by default only gives a short version output like this
```console
$ rustc --version
rustc 1.75.0-nightly (42b1224e9 2023-10-15)
```
There is, however, a more verbose version info that also includes the
LLVM version used:
```console
$ rustc --version --verbose
rustc 1.75.0-nightly (42b1224e9 2023-10-15)
binary: rustc
commit-hash: 42b1224e9eb37177f608d3f6a6f2be2ee13902e4
commit-date: 2023-10-15
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2
```
This is useful information, so it should be accessible.
---
I’d normally have used `--version --verbose`, but it seems that the
`versionFlag` property is passed as one single argument to `rustc` and
not split on spaces, so I used the short form `-vV` instead.