50 Commits

Author SHA1 Message Date
Alessandro Di Federico 5820908675 Remove and ban \file 2025-12-16 17:41:55 +01:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
In this commit we instruct the build system to use the unified schema
files  instead of collecting the `TUPLE-TREE-YAML` comments.

The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
2025-04-30 15:08:45 +02:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 492e5dc354 Yield: greatly simplify node size calculation 2025-02-13 13:09:50 +02:00
Ivan Krysak 8841bc7144 Don't include model::NameBuilder from the binary 2025-02-13 13:09:50 +02:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak a67ba96644 Adopt name builder across the model users 2024-11-06 15:43:13 +02:00
Alessandro Di Federico f9fad18cb4 EFA, Yield: handle blockless functions 2024-10-31 17:19:51 +01:00
Alessandro Di Federico 276a6e0efb s|ControlFlowGraph.h|CFGHelpers.h|g 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 6e49fed965 FunctionMetadata::{ControlFlowGraph,Blocks} 2024-06-20 10:24:51 +02:00
Ivan Krysak 44e5328477 Yield: add explicit directive support 2024-03-18 11:40:32 +00:00
Ivan Krysak e5328290c6 Yield: reorder disassembly processing
This commit moves stuff around to enforce complete information being
present by the time the "Internal" assembly output is ready.

Because of that, the "Internal" format needed to change, now it uses
tag representation close to PTML as opposed to the one close to LLVM's
used before now.
2024-03-18 10:58:52 +00:00
Ivan Krysak 7d235f4fd0 Enforce licence header consistency
Also do some basic cleanup: capitalize first letters, add `.`
at the end of the sentences, and so on.
2023-07-03 15:23:10 +00:00
Ivan Krysak 9f1d9fd5d0 Use Container::contains() where appropriate 2023-07-02 15:06:11 +00:00
Ivan Krysak bc98e0079f Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-02 13:20:49 +02:00
Ivan Krysak 7322d1a845 ControlFlow: switch to pipeline::Location 2023-05-17 14:08:05 +02:00
Ivan Krysak 50b5abf505 Yield: add isEmpty() helper to graph nodes 2023-05-17 14:08:05 +02:00
Ivan Krysak 013696a939 yield: move SVG out of the ControlFlow
Since the file is also used for call graphs, it's placement is not ideal
2023-05-17 14:08:05 +02:00
Ivan Krysak 045cdefcac GraphLayout: move outside of yield 2023-05-17 14:08:04 +02:00
Ivan Krysak a532f738e2 Yield: switch to new layouter invocation style 2023-04-27 18:12:28 +02:00
Ivan Krysak c5805a754a Sugiyama: switch to the new internal graph 2023-04-27 18:10:06 +02:00
Ivan Krysak 28574a87bc Yield: switch to layout's position and size 2023-04-27 18:09:38 +02:00
Ivan Krysak 00b450a8c2 Sugiyama: move the namespace under layout
Also removed a few entities to avoid duplication in the full names:
- `yield::layout::sugiyama::LayoutOrientation`
  -> `yield::layout::sugiyama::Orientation`
- `yield::layout::sugiyama::layout(...)`
  -> `yield::layout::sugiyama::compute(...)`
2023-04-27 17:28:22 +02:00
Ivan Krysak 44b9bfd04c Yield: SugiyamaStyle as a part of GraphLayout 2023-04-27 17:28:22 +02:00
Ivan Krysak 268f53cdeb Sugiyama: move the "main" file inside the layouter 2023-04-27 17:28:22 +02:00
Ivan Krysak 6d43876e78 SVG: move one of the sugiyama::layout overloads
It isn't generic enough to be kept in the header, so it was moved
closer to its users.
2023-04-27 17:28:22 +02:00
Ivan Krysak 7ca012dbc3 Minor improvements 2023-04-27 17:28:22 +02:00
Alessandro Di Federico f68b7866b3 Introduce BasicBlockID
This commit introduces `BasicBlockID` as the unique identifier for a
`efa::BasicBlock` into the CFG. A `BasicBlockID` is defined by a
`MetaAddress` plus an incremental integer. This enables us to have
multiple instances of the same block in a single function, which is
particularly useful when inlining multiple times the same function.

Apart from this, the commit also does the following:

* It drops representing `MetaAddress`es a `structs` in the IR. This created
  several issues related to ABI. We now represent them as strings.

* It defines more functions in `support.h`, instead of defining prototypes
  by hand in `CodeGenerator.cpp` and the like. Specifically, `unknownPC`
  and `raise_exception_helper`. We also introduce a C "constructor" for
  `PlainMetaAddress`.

* It significantly reduces the API of `GeneratedCodeBasicInfo`, which
  was supposed to be put on a diet since a long time.  Specifically,
  many jump target related methods have been moved to free functions in
  `IRHelpers.h`.  Also `GCBI::getSuccessors` has been pushed into its
  only user, `PruneRetSuccessors`, to prevent further usage of a
  deprecated API. In the future, it would be nice to drop it entirely.

* It introduces `efa::BasicBlock::InlinedFrom`.

* Introduce an enum to represent named argument indices for `newpc`.
  This enables us to more effectively manipulate its argument list.

* It improves the verification and error reporting for
  `efa::FunctionMetadata`.

* Update tests.

This commit is preliminary to another piece of work to improve the
generality of inlining beyond the simple "fake function" scenario, for
which the feature was originally conceived.
2023-02-23 14:51:10 +01:00
Giacomo Vercesi 5c6274aff7 Yield/SVG: fix xmlns attribute value
The `xmlns` attribute outputted contained two sets of `""` (one
introducted by the format string and one from `Tag`) which would break
strict XML parsers
2023-02-16 15:09:31 +01:00
Massimo Fioravanti dad043027d Rework and EFA yield cross relations
Yield and EFA shared the same namespace, this commits splits them and
introduces tuple tree containers as well.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00
Alessandro Di Federico 974dd0c680 yield::Function: do not use efa::BasicBlock
This change introduces some duplication but ensures an important
property of `tuple_tree_generate`d: data structures: all the leaves are
scalars. Previously, yield::Function was using efa::BasicBlock, making
things more difficult under certain conditions.
Specifically, we can rely on the fact that, when generating a visit to
the TupleTree, we know everything about all non-scalars.
2022-12-09 10:11:27 +01:00
Alessandro Di Federico 66b12ad540 Yield: move CrossRelation into its own directory
Also, use ROOT_TYPE.
2022-12-09 10:11:27 +01:00
Giacomo Vercesi 4d0f72548a ControlFlow/SVG: switch to simple tree layouter 2022-10-11 17:10:06 +02:00
Ivan Krysak b94c23cf52 Yield/ControlFlow: stop accounting for footer 2022-10-11 17:09:39 +02:00
Ivan Krysak 3cd801dbac SVG: introduce slices-to-SVG converter 2022-09-26 12:09:03 +02:00
Ivan Krysak 15f0c816c6 SVG Exporter: adopt ptml::Tag 2022-09-26 12:08:47 +02:00
Ivan Krysak 63019a3850 Yield: add a Graph keyword to SVG emitters 2022-09-26 12:08:22 +02:00
Ivan Krysak cf5c010a7c Layouter: introduce simple tree specialization 2022-09-26 10:33:43 +02:00
Ivan Krysak b267868356 CFG: fix calculateViewBox for entryless graphs 2022-09-26 10:33:43 +02:00
Ivan Krysak 0c7785bc38 Layouter & SVG: improve handling of empty graphs 2022-09-26 10:33:43 +02:00
Ivan Krysak c90a49ec56 SVG Exporter: introduce call graph flavour 2022-09-26 10:33:43 +02:00
Ivan Krysak 7037be8b90 SVG Exporter: improve arrow head customizability 2022-09-26 10:33:43 +02:00
Giacomo Vercesi 3e9058393e Rework YieldAssemblyHTML to output PTML 2022-07-28 08:47:34 +02:00
Ivan Krysak 71115c8062 Implement SVG control flow exporter 2022-06-15 16:04:44 +03:00
Ivan Krysak 7591788620 Implement node size calculation 2022-06-15 16:04:44 +03:00
Ivan Krysak 840a34c0a4 Implement CFG extraction 2022-06-15 16:04:44 +03:00
Ivan Krysak b19663e439 Implement labeled block detection 2022-06-15 16:03:45 +03:00
Ivan Krysak de9861815a Move fallthrough detection to yield::cfg 2022-06-15 16:02:44 +03:00
Ivan Krysak 80e9243e06 Add a basic CFG pipeline 2022-06-15 15:52:26 +03:00