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.
Apparently AST for ldc is an abuse of terminology, as it doesn't
produces anything resembling a syntax tree:
https://github.com/dlang/dmd/pull/6556#issuecomment-282353400 . It is
potentially meaningful only to ldc developers. Anyway the `generateAST`
result type is fixed, along with some other small stuff around.
<!-- 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!
-->
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.
A majority of the actions/backends expect to find certain classes and
definitions in the source code. There's no canonical reference for this
so it's a combination of incomplete docs and the actual uses in
llvm-project.
(most of the time I expect people will come from llvm-project to
experiment, rather than the other way around)
I've added an example that uses the Searchable Tables backend.
<!-- 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!
-->
The filtering of directive lines (those starting with dot) is already
performed at `parser.filterData`. All that was missing is dropping empty
"functions".
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.
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.