From 3d017f63a3819d91732d3feebbb2882014c8e594 Mon Sep 17 00:00:00 2001 From: Khaled Ismaeel Date: Wed, 23 Apr 2025 18:20:59 +0200 Subject: [PATCH] Remove embedded `TUPLE-TREE-YAML` --- include/revng/ABI/Definition.h | 99 -------- include/revng/ABI/ScalarType.h | 22 -- .../revng/EarlyFunctionAnalysis/BasicBlock.h | 26 -- .../revng/EarlyFunctionAnalysis/CallEdge.h | 28 --- .../EarlyFunctionAnalysis/ControlFlowGraph.h | 22 -- .../EarlyFunctionAnalysis/FunctionEdge.h | 8 - .../EarlyFunctionAnalysis/FunctionEdgeBase.h | 27 -- .../EarlyFunctionAnalysis/FunctionEdgeType.h | 23 -- include/revng/Model/ABI.h | 150 ----------- include/revng/Model/Architecture.h | 13 - include/revng/Model/Argument.h | 23 -- include/revng/Model/ArrayType.h | 16 -- include/revng/Model/Binary.h | 86 ------- include/revng/Model/CABIFunctionDefinition.h | 34 --- include/revng/Model/CallSitePrototype.h | 25 -- include/revng/Model/CanonicalRegisterValue.h | 22 -- include/revng/Model/Configuration.h | 25 -- include/revng/Model/DefinedType.h | 12 - .../revng/Model/DisassemblyConfiguration.h | 48 ---- .../DisassemblyConfigurationAddressStyle.h | 31 +-- .../DisassemblyConfigurationImmediateStyle.h | 10 +- include/revng/Model/DynamicFunction.h | 35 --- include/revng/Model/EnumDefinition.h | 25 -- include/revng/Model/EnumEntry.h | 23 -- include/revng/Model/Function.h | 58 ----- include/revng/Model/FunctionAttribute.h | 13 +- include/revng/Model/NamedTypedRegister.h | 23 -- include/revng/Model/NamingConfiguration.h | 174 ------------- include/revng/Model/PointerType.h | 15 -- include/revng/Model/PrimitiveKind.h | 28 --- include/revng/Model/PrimitiveType.h | 24 -- include/revng/Model/RawFunctionDefinition.h | 69 ------ include/revng/Model/Register.h | 234 ------------------ include/revng/Model/Relocation.h | 25 -- include/revng/Model/RelocationType.h | 37 --- include/revng/Model/Segment.h | 60 ----- include/revng/Model/StatementComment.h | 30 --- include/revng/Model/StructDefinition.h | 24 -- include/revng/Model/StructField.h | 24 -- include/revng/Model/Type.h | 14 -- include/revng/Model/TypeDefinition.h | 35 --- include/revng/Model/TypeKind.h | 1 + include/revng/Model/TypedefDefinition.h | 16 -- include/revng/Model/UnionDefinition.h | 14 -- include/revng/Model/UnionField.h | 24 -- .../revng/Pipeline/Description/AnalysesList.h | 17 -- include/revng/Pipeline/Description/Analysis.h | 22 -- .../Description/AnalysisContainerInput.h | 17 -- .../Pipeline/Description/AnalysisOption.h | 15 -- .../Pipeline/Description/AnalysisReference.h | 16 -- .../revng/Pipeline/Description/Artifacts.h | 19 -- .../revng/Pipeline/Description/Container.h | 15 -- include/revng/Pipeline/Description/Kind.h | 31 --- .../Description/PipelineDescription.h | 35 --- include/revng/Pipeline/Description/Rank.h | 19 -- include/revng/Pipeline/Description/Step.h | 29 --- include/revng/Pipes/ModelGlobal.h | 2 +- include/revng/Yield/BasicBlock.h | 57 ----- include/revng/Yield/CallEdge.h | 28 --- .../Yield/CrossRelations/CrossRelations.h | 10 - .../CrossRelations/RelationDescription.h | 17 -- include/revng/Yield/Function.h | 18 -- include/revng/Yield/FunctionEdge.h | 8 - include/revng/Yield/FunctionEdgeBase.h | 27 -- include/revng/Yield/FunctionEdgeType.h | 23 -- include/revng/Yield/Instruction.h | 51 ---- include/revng/Yield/TagAttribute.h | 16 -- include/revng/Yield/TagType.h | 23 -- include/revng/Yield/TaggedLine.h | 18 -- include/revng/Yield/TaggedString.h | 24 -- share/revng/clang-format-style-file.yml | 2 + tests/unit/TupleTreeGenerator/TestClass.h | 23 -- tests/unit/TupleTreeGenerator/TestEnum.h | 8 - 73 files changed, 7 insertions(+), 2358 deletions(-) diff --git a/include/revng/ABI/Definition.h b/include/revng/ABI/Definition.h index f7826a300..2ca21ab62 100644 --- a/include/revng/ABI/Definition.h +++ b/include/revng/ABI/Definition.h @@ -16,105 +16,6 @@ #include "revng/TupleTree/TupleTree.h" #include "revng/TupleTree/TupleTreeDiff.h" -/* TUPLE-TREE-YAML - -name: Definition -type: struct -doc: for the documentation see `references/abi-definition.md` -fields: - - name: ABI - type: model::ABI::Values - - - name: ArgumentsArePositionBased - type: bool - - - name: OnlyStartDoubleArgumentsFromAnEvenRegister - type: bool - - name: ArgumentsCanBeSplitBetweenRegistersAndStack - type: bool - - name: BigArgumentsUsePointersToCopy - type: bool - - name: NoRegisterArgumentsCanComeAfterStackOnes - type: bool - - name: AllowPackedTypesInRegisters - type: bool - - name: CalleeIsResponsibleForStackCleanup - type: bool - - name: FloatsUseGPRs - type: bool - - name: PackStackArguments - type: bool - - name: TreatAllAggregatesAsPacked - type: bool - - - name: StackAlignment - type: uint64_t - - name: MinimumStackArgumentSize - type: uint64_t - - name: UnusedStackArgumentBytes - type: uint64_t - optional: true - - - name: MaximumGPRsPerAggregateArgument - type: uint64_t - - name: MaximumGPRsPerAggregateReturnValue - type: uint64_t - - name: MaximumGPRsPerScalarArgument - type: uint64_t - - name: MaximumGPRsPerScalarReturnValue - type: uint64_t - - - name: GeneralPurposeArgumentRegisters - sequence: - type: std::vector - elementType: model::Register::Values - optional: true - - name: GeneralPurposeReturnValueRegisters - sequence: - type: std::vector - elementType: model::Register::Values - optional: true - - name: VectorArgumentRegisters - sequence: - type: std::vector - elementType: model::Register::Values - optional: true - - name: VectorReturnValueRegisters - sequence: - type: std::vector - elementType: model::Register::Values - optional: true - - name: CalleeSavedRegisters - sequence: - type: std::vector - elementType: model::Register::Values - optional: true - - - name: ReturnValueLocationRegister - type: model::Register::Values - optional: true - - name: ReturnValueLocationOnStack - type: bool - optional: true - - name: ReturnValueLocationIsReturned - type: bool - optional: true - - - name: ScalarTypes - sequence: - type: SortedVector - elementType: ScalarType - - - name: FloatingPointScalarTypes - sequence: - type: SortedVector - elementType: ScalarType - -key: - - ABI - -TUPLE-TREE-YAML */ - #include "revng/ABI/Generated/Early/Definition.h" namespace abi { diff --git a/include/revng/ABI/ScalarType.h b/include/revng/ABI/ScalarType.h index ad4025df3..c5368982f 100644 --- a/include/revng/ABI/ScalarType.h +++ b/include/revng/ABI/ScalarType.h @@ -6,28 +6,6 @@ #include -/* TUPLE-TREE-YAML - -name: ScalarType -type: struct -doc: | - Represents type specific information ABI needs to be aware of, - for example, alignment. -fields: - - name: Size - type: uint64_t - - - name: AlignedAt - doc: | - When set to `0` (default), the alignment of this type matches its size - type: uint64_t - optional: true - -key: - - Size - -TUPLE-TREE-YAML */ - #include "revng/ABI/Generated/Early/ScalarType.h" namespace abi { diff --git a/include/revng/EarlyFunctionAnalysis/BasicBlock.h b/include/revng/EarlyFunctionAnalysis/BasicBlock.h index 50f0a2b99..70e6b5dd3 100644 --- a/include/revng/EarlyFunctionAnalysis/BasicBlock.h +++ b/include/revng/EarlyFunctionAnalysis/BasicBlock.h @@ -14,32 +14,6 @@ #include "revng/Support/BasicBlockID/YAMLTraits.h" #include "revng/Support/MetaAddress.h" -/* TUPLE-TREE-YAML -name: BasicBlock -doc: The basic block of a function -type: struct -fields: - - name: ID - type: BasicBlockID - - name: End - doc: | - End address of the basic block, i.e., the address where the last - instruction ends - type: MetaAddress - - name: InlinedFrom - type: MetaAddress - optional: true - doc: Address of the function this basic block has been inlined from - - name: Successors - doc: List of successor edges - sequence: - type: SortedVector - upcastable: true - elementType: FunctionEdgeBase -key: - - ID -TUPLE-TREE-YAML */ - #include "revng/EarlyFunctionAnalysis/Generated/Early/BasicBlock.h" namespace model { diff --git a/include/revng/EarlyFunctionAnalysis/CallEdge.h b/include/revng/EarlyFunctionAnalysis/CallEdge.h index 11ef073f1..66c2c0cf3 100644 --- a/include/revng/EarlyFunctionAnalysis/CallEdge.h +++ b/include/revng/EarlyFunctionAnalysis/CallEdge.h @@ -9,34 +9,6 @@ #include "revng/Model/Binary.h" #include "revng/Model/FunctionAttribute.h" -/* TUPLE-TREE-YAML -name: CallEdge -doc: A CFG edge to represent function calls (direct, indirect and tail calls) -type: struct -inherits: FunctionEdgeBase -fields: - - name: DynamicFunction - doc: | - Name of the dynamic function being called, or empty if not a dynamic call - type: string - optional: true - - name: IsTailCall - doc: Is this a tail call? - type: bool - optional: true - - name: Attributes - doc: | - Attributes for this function - - Note: To have the effective list of attributes for this call site, you - have to add attributes on the called function. - TODO: switch to std::set - sequence: - type: MutableSet - elementType: model::FunctionAttribute::Values - optional: true -TUPLE-TREE-YAML */ - #include "revng/EarlyFunctionAnalysis/Generated/Early/CallEdge.h" namespace model { diff --git a/include/revng/EarlyFunctionAnalysis/ControlFlowGraph.h b/include/revng/EarlyFunctionAnalysis/ControlFlowGraph.h index e65f6b695..63e652fe0 100644 --- a/include/revng/EarlyFunctionAnalysis/ControlFlowGraph.h +++ b/include/revng/EarlyFunctionAnalysis/ControlFlowGraph.h @@ -15,28 +15,6 @@ class BasicBlock; } class GeneratedCodeBasicInfo; -/* TUPLE-TREE-YAML -name: ControlFlowGraph -doc: "Metadata attached to a function. As of now, it includes a list of basic -blocks, representing the control-flow graph." -type: struct -fields: - - name: Entry - doc: Start address of the basic block - type: MetaAddress - - name: Name - type: string - doc: Optional name for debugging purposes - optional: true - - name: Blocks - sequence: - type: SortedVector - elementType: BasicBlock - optional: true -key: - - Entry -TUPLE-TREE-YAML */ - #include "revng/EarlyFunctionAnalysis/Generated/Early/ControlFlowGraph.h" namespace model { diff --git a/include/revng/EarlyFunctionAnalysis/FunctionEdge.h b/include/revng/EarlyFunctionAnalysis/FunctionEdge.h index 613c03318..4c13fbd07 100644 --- a/include/revng/EarlyFunctionAnalysis/FunctionEdge.h +++ b/include/revng/EarlyFunctionAnalysis/FunctionEdge.h @@ -6,14 +6,6 @@ #include "revng/EarlyFunctionAnalysis/FunctionEdgeBase.h" -/* TUPLE-TREE-YAML -name: FunctionEdge -doc: An edge on the CFG -type: struct -inherits: FunctionEdgeBase -fields: [] -TUPLE-TREE-YAML */ - #include "revng/EarlyFunctionAnalysis/Generated/Early/FunctionEdge.h" namespace model { diff --git a/include/revng/EarlyFunctionAnalysis/FunctionEdgeBase.h b/include/revng/EarlyFunctionAnalysis/FunctionEdgeBase.h index 074e21b19..ed728d0e3 100644 --- a/include/revng/EarlyFunctionAnalysis/FunctionEdgeBase.h +++ b/include/revng/EarlyFunctionAnalysis/FunctionEdgeBase.h @@ -9,33 +9,6 @@ #include "revng/Support/MetaAddress.h" #include "revng/Support/MetaAddress/YAMLTraits.h" -/* TUPLE-TREE-YAML -name: FunctionEdgeBase -doc: An edge on the CFG -type: struct -fields: - - name: Destination - optional: true - doc: | - Target of the CFG edge - - If invalid, it's an indirect edge such as a return instruction or an - indirect function call. - If valid, it's either the address of the basic block in case of a direct - branch, or, in case of a function call, the address of the callee. - TODO: switch to TupleTreeReference - type: BasicBlockID - - name: Kind - type: FunctionEdgeBaseKind - - name: Type - doc: Type of the CFG edge - type: FunctionEdgeType -key: - - Destination - - Kind -abstract: true -TUPLE-TREE-YAML */ - #include "revng/EarlyFunctionAnalysis/Generated/Early/FunctionEdgeBase.h" namespace model { diff --git a/include/revng/EarlyFunctionAnalysis/FunctionEdgeType.h b/include/revng/EarlyFunctionAnalysis/FunctionEdgeType.h index 380df37ca..b5d237cf9 100644 --- a/include/revng/EarlyFunctionAnalysis/FunctionEdgeType.h +++ b/include/revng/EarlyFunctionAnalysis/FunctionEdgeType.h @@ -4,29 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: FunctionEdgeType -doc: Type of edge on the CFG -type: enum -members: - - name: DirectBranch - doc: Branch due to function-local CFG (a regular branch) - - name: FunctionCall - doc: A function call for which the cache was able to produce a summary - - name: Return - doc: A proper function return - - name: BrokenReturn - doc: | - A branch returning to the return address, but leaving the stack in an - unexpected situation - - name: LongJmp - doc: A branch representing a longjmp or similar constructs - - name: Killer - doc: A killer basic block (killer syscall or endless loop) - - name: Unreachable - doc: The basic block ends with an unreachable instruction -TUPLE-TREE-YAML */ - #include "revng/EarlyFunctionAnalysis/Generated/Early/FunctionEdgeType.h" // TODO: we need to handle noreturn function calls diff --git a/include/revng/Model/ABI.h b/include/revng/Model/ABI.h index b1c688fa9..429a6da7c 100644 --- a/include/revng/Model/ABI.h +++ b/include/revng/Model/ABI.h @@ -6,156 +6,6 @@ #include "revng/Model/Architecture.h" -/* TUPLE-TREE-YAML -name: ABI -type: enum -members: - - name: SystemV_x86_64 - doc: | - 64-bit SystemV ABI for x86 processor architecture - ([reference](https://gitlab.com/x86-psABIs/x86-64-ABI)). - - name: SystemV_x86 - doc: | - 32-bit SystemV ABI for x86 processor architecture ([reference][abi1]). - - [abi1]: https://gitlab.com/x86-psABIs/i386-ABI/-/tree/hjl/x86/master - - - name: SystemV_x86_regparm_3 - doc: | - A GCC specific modification of the 32-bit SystemV ABI for x86 processor - architecture. It allows three first GPR-sized arguments to be passed - using the EAX, EDX, and ECX registers. - See the reference for `regparm` x86 function attribute. - - - name: SystemV_x86_regparm_2 - doc: | - A GCC specific modification of the 32-bit SystemV ABI for x86 processor - architecture. It allows two first GPR-sized arguments to be passed - using the EAX, and ECX registers. - See the GCC documentation for `regparm` x86 function attribute. - - - name: SystemV_x86_regparm_1 - doc: | - A GCC specific modification of the 32-bit SystemV ABI for x86 processor - architecture. It allows the first GPR-sized argument to be passed - using the EAX register. - See the GCC documentation for `regparm` x86 function attribute. - - - name: Microsoft_x86_64 - doc: > - 64-bit Microsoft ABI for x86 processor architecture - ([reference][abi2]). - - [abi2]: https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention - - - name: Microsoft_x86_64_vectorcall - doc: | - A modification of 64-bit Microsoft ABI for x86 processor architecture - ([reference](https://docs.microsoft.com/en-us/cpp/cpp/vectorcall)). - It allows using extra vector registers for passing function arguments. - - - name: Microsoft_x86_cdecl - doc: | - The default 32-bit Microsoft ABI for x86 processor architecture - ([reference](https://docs.microsoft.com/en-us/cpp/cpp/cdecl)). - It was indented to be compatible with `SystemV_x86` but there are slight - differences. - - - name: Microsoft_x86_cdecl_gcc - doc: | - 32-bit Microsoft x86 `cdecl` abi as implemented in GCC (subtly different - from the original). - - - name: Microsoft_x86_stdcall - doc: | - A modification of the 32-bit `__cdecl` Microsoft ABI for x86 processor - architecture - ([reference](https://docs.microsoft.com/en-us/cpp/cpp/stdcall)). - The main difference is the fact that the callee is responsible for stack - cleanup instead of the caller. - - - name: Microsoft_x86_stdcall_gcc - doc: | - 32-bit Microsoft x86 `stdcall` abi as implemented in GCC (subtly different - from the original). - - - name: Microsoft_x86_thiscall - doc: | - A modification of the 32-bit `__stdcall` Microsoft ABI for x86 processor - architecture - ([reference](https://docs.microsoft.com/en-us/cpp/cpp/thiscall)). - The main difference is the fact that it allows to pass a - single (the first) function argument using a register. This ABI is only - used for member function call where the first argument is always a `this` - pointer. - - - name: Microsoft_x86_fastcall - doc: | - A modification of the 32-bit `__stdcall` Microsoft ABI for x86 processor - architecture - ([reference](https://docs.microsoft.com/en-us/cpp/cpp/fastcall)). - The main difference is the fact that it allows to pass two - first GPR-sized non-aggregate function arguments in registers. - - - name: Microsoft_x86_fastcall_gcc - doc: | - 32-bit Microsoft x86 `fastcall` abi as implemented in GCC (subtly - different from the original). - - - name: Microsoft_x86_vectorcall - doc: | - A modification of the 32-bit `__fastcall` Microsoft ABI for x86 processor - architecture - ([reference](https://docs.microsoft.com/en-us/cpp/cpp/vectorcall)). - It allows using extra vector registers for passing function arguments. - - - name: AAPCS64 - doc: | - Stands for `Arm Architecture Procedure Call Standard (64-bit)` - ([reference](https://github.com/ARM-software/abi-aa/releases)). - The official ABI for AArch64 (ARM64) processor architecture. - - - name: Microsoft_AAPCS64 - doc: > - Stands for "Arm Architecture Procedure Call Standard (64-bit)". - This represents the version of the ABI used by windows-on-arm. - For differences from the original ABI see the [reference][ab3]. - - [ab3]: https://learn.microsoft.com/cpp/build/arm64-windows-abi-conventions - - - name: Apple_AAPCS64 - doc: "Stands for \"Arm Architecture Procedure Call Standard (64-bit)\".\n - This represents the version of the ABI used by the apple products.\n - For differences from the original ABI see the [reference](\ - https://developer.apple.com/documentation/xcode/writing-arm64- - code-for-apple-platforms)." - - - name: AAPCS - doc: | - Stands for "Arm Architecture Procedure Call Standard" - ([reference](https://github.com/ARM-software/abi-aa/releases)). - The official ABI for ARM processor architecture. - - - name: SystemV_MIPS_o32 - doc: > - The ABI for MIPS RISC processor architecture - ([reference][abi4]). - - [abi4]: http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf - - - name: SystemV_MIPSEL_o32 - doc: > - The ABI for little-endian edition of the MIPS RISC processor architecture - ([reference][abi5]). - - [abi5]: http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf - - - name: SystemZ_s390x - doc: | - The s390x ABI for SystemZ processor architecture - ([reference](https://github.com/IBM/s390x-abi)). -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/ABI.h" namespace model::ABI { diff --git a/include/revng/Model/Architecture.h b/include/revng/Model/Architecture.h index ebc2edb15..da61ba5e1 100644 --- a/include/revng/Model/Architecture.h +++ b/include/revng/Model/Architecture.h @@ -6,19 +6,6 @@ #include "llvm/ADT/Triple.h" -/* TUPLE-TREE-YAML -name: Architecture -type: enum -members: - - name: x86 - - name: x86_64 - - name: arm - - name: aarch64 - - name: mips - - name: mipsel - - name: systemz -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Architecture.h" namespace model::Architecture { diff --git a/include/revng/Model/Argument.h b/include/revng/Model/Argument.h index 55ebb454f..a6e587720 100644 --- a/include/revng/Model/Argument.h +++ b/include/revng/Model/Argument.h @@ -7,29 +7,6 @@ #include "revng/ADT/RecursiveCoroutine.h" #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: Argument -doc: | - The argument of a `CABIFunctionType`. -type: struct -fields: - - name: Index - type: uint64_t - doc: The argument index. - - name: Type - type: Type - doc: The type of the argument. - upcastable: true - - name: Name - type: string - optional: true - - name: Comment - type: string - optional: true -key: - - Index -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Argument.h" namespace model { diff --git a/include/revng/Model/ArrayType.h b/include/revng/Model/ArrayType.h index 402535a70..fdcf1eb12 100644 --- a/include/revng/Model/ArrayType.h +++ b/include/revng/Model/ArrayType.h @@ -6,22 +6,6 @@ #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: ArrayType -type: struct -doc: |- - An array of `Type`s. -inherits: Type -fields: - - name: ElementCount - type: uint64_t - doc: The number of elements. - - name: ElementType - type: Type - upcastable: true - doc: The type of the elements of the array. -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/ArrayType.h" class model::ArrayType : public model::generated::ArrayType { diff --git a/include/revng/Model/Binary.h b/include/revng/Model/Binary.h index 1787d984b..f0b9b2b80 100644 --- a/include/revng/Model/Binary.h +++ b/include/revng/Model/Binary.h @@ -31,92 +31,6 @@ #include "revng/TupleTree/TupleTree.h" #include "revng/TupleTree/TupleTreeDiff.h" -/* TUPLE-TREE-YAML -name: Binary -doc: |- - Data structure representing the whole binary. - This is the entry point of the model. - It contains the type system (`Types`), the list of functions (`Functions`), - loading information (`Segments`) and more. -type: struct -fields: - - name: Architecture - doc: The architecture for this binary. - type: Architecture - optional: true - - name: EntryPoint - doc: The program entry point, if any. - type: MetaAddress - optional: true - - name: DefaultABI - doc: The default ABI to adopt for analysis purposes. - type: ABI - optional: true - - name: DefaultPrototype - doc: |- - The default function prototype to adopt for functions that do not provide - it explicitly. - type: Type - optional: true - upcastable: true - - name: Configuration - type: Configuration - optional: true - - name: Segments - doc: |- - `Segment`s represent instructions on what part of the raw binary needs to - be loaded at which address. - sequence: - type: SortedVector - elementType: Segment - optional: true - - name: ExtraCodeAddresses - doc: |- - A list of addresses known to contain code. - rev.ng is usually able to discover all the code by itself by recursively - visiting the control-flow graph of functions and the call graph. - However, certain pieces of code cannot be identified through these - techniques. - A prime example are the addresses of `catch` blocks of C++ exception - handlers: no code ever directly jumps there and their address is not - stored in jump tables. Their address can only be obtained by interpreting - metadata in the ELF. - optional: true - sequence: - type: SortedVector - elementType: MetaAddress - - name: ImportedLibraries - doc: |- - The list of imported libraries identified by their file name. - For instance, if the input binary is linked to OpenSSL, this list would - should `libcrypto.so.1.1`. - sequence: - type: SortedVector - elementType: string - optional: true - - name: ImportedDynamicFunctions - doc: List of functions imported from dynamic libraries (`.so`, `.dll`). - sequence: - type: SortedVector - elementType: DynamicFunction - optional: true - - name: Functions - doc: List of the functions present in the binary. - sequence: - type: SortedVector - elementType: Function - optional: true - - name: TypeDefinitions - doc: |- - The set of types used in this binary. - It contains `struct`, `union`, `typedef`, `enum` and function prototypes. - sequence: - type: SortedVector - upcastable: true - elementType: TypeDefinition - optional: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Binary.h" namespace model { diff --git a/include/revng/Model/CABIFunctionDefinition.h b/include/revng/Model/CABIFunctionDefinition.h index ceea57c54..2981cc6e3 100644 --- a/include/revng/Model/CABIFunctionDefinition.h +++ b/include/revng/Model/CABIFunctionDefinition.h @@ -9,40 +9,6 @@ #include "revng/Model/Type.h" #include "revng/Model/TypeDefinition.h" -/* TUPLE-TREE-YAML -name: CABIFunctionDefinition -doc: | - The function type described through a C-like prototype plus an ABI. - - This is an "high level" representation of the prototype of a function. It is - expressed as list of arguments composed by an index and a type. No - information about the register is embedded. That information is implicit in - the ABI this type is associated to. - - In contrast, a `RawFunctionType` is not associated to any ABI and explicitly - describes, among other things, what registers are used to pass arguments and - return values. -type: struct -inherits: TypeDefinition -fields: - - name: ABI - type: ABI - doc: The C ABI associated to this function type. - - name: ReturnType - type: Type - doc: The function return type. - optional: true - upcastable: true - - name: ReturnValueComment - type: string - optional: true - - name: Arguments - doc: The list of formal arguments of the function type. - sequence: - type: SortedVector - elementType: Argument -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/CABIFunctionDefinition.h" class model::CABIFunctionDefinition diff --git a/include/revng/Model/CallSitePrototype.h b/include/revng/Model/CallSitePrototype.h index 418f7349a..a9086d3d5 100644 --- a/include/revng/Model/CallSitePrototype.h +++ b/include/revng/Model/CallSitePrototype.h @@ -10,31 +10,6 @@ #include "revng/Support/MetaAddress/YAMLTraits.h" #include "revng/TupleTree/TupleTree.h" -/* TUPLE-TREE-YAML -name: CallSitePrototype -doc: Information about the prototype of a specific callsite within a `Function`. -type: struct -fields: - - name: CallerBlockAddress - doc: Address of the basic block of the call. - type: MetaAddress - - name: Prototype - type: Type - upcastable: true - - name: IsTailCall - doc: Whether this call site is a tail call or not. - type: bool - optional: true - - name: Attributes - doc: Attributes for this call site. - sequence: - type: MutableSet - elementType: FunctionAttribute - optional: true -key: - - CallerBlockAddress -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/CallSitePrototype.h" class model::CallSitePrototype diff --git a/include/revng/Model/CanonicalRegisterValue.h b/include/revng/Model/CanonicalRegisterValue.h index 72a7a20db..af665deb9 100644 --- a/include/revng/Model/CanonicalRegisterValue.h +++ b/include/revng/Model/CanonicalRegisterValue.h @@ -6,28 +6,6 @@ #include "revng/ADT/SortedVector.h" -/* TUPLE-TREE-YAML -name: CanonicalRegisterValue -doc: |- - A [`Segment`](#Segment) can specify a set of *canonical values* for certain - registers. - This can be used to represent concepts such as the global pointer, which in - certain ABIs, is not set by each function, but it's possible to assume it has - a certain value at the entry of the function. -type: struct -fields: - - name: Register - doc: The register for which to specify the canonical value. - type: Register - - name: Value - doc: |- - The canonical value that `Register` can be assumed to hold upon - function entry. - type: uint64_t -key: - - Register -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/CanonicalRegisterValue.h" namespace model { diff --git a/include/revng/Model/Configuration.h b/include/revng/Model/Configuration.h index 2dde6fabb..317eb8817 100644 --- a/include/revng/Model/Configuration.h +++ b/include/revng/Model/Configuration.h @@ -7,31 +7,6 @@ #include "revng/Model/DisassemblyConfiguration.h" #include "revng/Model/NamingConfiguration.h" -/* TUPLE-TREE-YAML -name: Configuration -type: struct -fields: - - name: Disassembly - type: DisassemblyConfiguration - optional: true - - - name: Naming - type: NamingConfiguration - optional: true - - # Configuration options that don't belong anywhere else find themselves here. - # As this list grows, they should be split into their own sub-sections. - - name: CommentLineWidth - doc: | - Sets a recommended comment line width to improve their readability. - - The default value is `80`. - - Set to `-1` for unlimited line size. - type: uint64_t - optional: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Configuration.h" namespace model { diff --git a/include/revng/Model/DefinedType.h b/include/revng/Model/DefinedType.h index 39e6e7595..19b4631c2 100644 --- a/include/revng/Model/DefinedType.h +++ b/include/revng/Model/DefinedType.h @@ -6,18 +6,6 @@ #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: DefinedType -type: struct -inherits: Type -doc: A reference to a `TypeDefinition`. -fields: - - name: Definition - reference: - pointeeType: TypeDefinition - rootType: Binary -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/DefinedType.h" class model::DefinedType : public model::generated::DefinedType { diff --git a/include/revng/Model/DisassemblyConfiguration.h b/include/revng/Model/DisassemblyConfiguration.h index 63f32bdbb..f7ae682d0 100644 --- a/include/revng/Model/DisassemblyConfiguration.h +++ b/include/revng/Model/DisassemblyConfiguration.h @@ -7,54 +7,6 @@ #include "revng/Model/DisassemblyConfigurationAddressStyle.h" #include "revng/Model/DisassemblyConfigurationImmediateStyle.h" -/* TUPLE-TREE-YAML -name: DisassemblyConfiguration -type: struct -fields: - - name: DisableEmissionOfInstructionAddress - type: bool - optional: true - - - name: DisableEmissionOfRawBytes - type: bool - optional: true - - - name: UseATTSyntax - doc: x86-only. - type: bool - optional: true - - - name: AddressStyle - doc: | - The default value is `Smart`. See the related enum for further - explanation. - type: DisassemblyConfigurationAddressStyle - optional: true - - - name: ImmediateStyle - doc: | - The default value is `CHexadecimal`. See the related enum for further - explanation. - type: DisassemblyConfigurationImmediateStyle - optional: true - - - name: PrintFullMetaAddress - doc: | - Set this to true to include the full meta-address whenever one is printed. - The default value of `false` omits the address type as long as it matches - that of the binary. - type: bool - optional: true - - - name: BasicBlockPrefix - doc: | - The prefix attached to the basic block address in the disassembly views. - The default value is `bb_`. - type: string - optional: true - -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/DisassemblyConfiguration.h" class model::DisassemblyConfiguration diff --git a/include/revng/Model/DisassemblyConfigurationAddressStyle.h b/include/revng/Model/DisassemblyConfigurationAddressStyle.h index 237958374..1b5215dee 100644 --- a/include/revng/Model/DisassemblyConfigurationAddressStyle.h +++ b/include/revng/Model/DisassemblyConfigurationAddressStyle.h @@ -4,35 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: DisassemblyConfigurationAddressStyle -type: enum -members: - - name: Smart - doc: | - Look for the addresses among basic blocks and functions. - When a match is found, replace the addresses with relevant labels. - Otherwise, prints an absolute address instead. - - - name: SmartWithPCRelativeFallback - doc: | - Same as `Smart`, except when unable to single out the target, - print a PC-relative address instead. - - - name: Strict - doc: | - Same as `Smart`, except when unable to single out the target, - print an error token. - - - name: Global - doc: | - Convert PC relative addresses into global representation. - - - name: PCRelative - doc: | - Print all the addresses exactly how disassembler emitted them - in PC-relative mode. -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/DisassemblyConfigurationAddressStyle.h" + #include "revng/Model/Generated/Late/DisassemblyConfigurationAddressStyle.h" diff --git a/include/revng/Model/DisassemblyConfigurationImmediateStyle.h b/include/revng/Model/DisassemblyConfigurationImmediateStyle.h index 4c42e2c44..374d4688e 100644 --- a/include/revng/Model/DisassemblyConfigurationImmediateStyle.h +++ b/include/revng/Model/DisassemblyConfigurationImmediateStyle.h @@ -4,14 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: DisassemblyConfigurationImmediateStyle -type: enum -members: - - name: Decimal - - name: CHexadecimal - - name: AsmHexadecimal -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/DisassemblyConfigurationImmediateStyle.h" + #include "revng/Model/Generated/Late/DisassemblyConfigurationImmediateStyle.h" diff --git a/include/revng/Model/DynamicFunction.h b/include/revng/Model/DynamicFunction.h index b2e26ff37..1d942d057 100644 --- a/include/revng/Model/DynamicFunction.h +++ b/include/revng/Model/DynamicFunction.h @@ -7,41 +7,6 @@ #include "revng/ADT/MutableSet.h" #include "revng/Model/CommonFunctionMethods.h" -/* TUPLE-TREE-YAML -name: DynamicFunction -doc: A function defined in a dynamic library. -type: struct -fields: - - name: Name - doc: The name of the symbol for this dynamic function. - type: string - - name: Comment - type: string - optional: true - - name: Prototype - doc: The prototype of the function. - type: Type - upcastable: true - optional: true - - name: Attributes - doc: The attributes of this dynamic function. - sequence: - type: MutableSet - elementType: FunctionAttribute - optional: true - - name: Relocations - doc: |- - A list of locations where the address of this dynamic function should - be placed. - sequence: - type: SortedVector - elementType: Relocation - optional: true - -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/DynamicFunction.h" namespace model { diff --git a/include/revng/Model/EnumDefinition.h b/include/revng/Model/EnumDefinition.h index 3d2e3f939..e06d8e745 100644 --- a/include/revng/Model/EnumDefinition.h +++ b/include/revng/Model/EnumDefinition.h @@ -7,31 +7,6 @@ #include "revng/Model/EnumEntry.h" #include "revng/Model/TypeDefinition.h" -/* TUPLE-TREE-YAML -name: EnumDefinition -doc: | - An `enum` type definition. -type: struct -inherits: TypeDefinition -fields: - - name: UnderlyingType - type: Type - upcastable: true - doc: |- - The underlying type of the `enum`. - - This can only be a `PrimitiveType` with either a `Unsigned` or a `Signed` - kind. - - name: Entries - doc: |- - The entries of the `enum`. - - There can be no two entries associated to the same value. - sequence: - type: SortedVector - elementType: EnumEntry -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/EnumDefinition.h" class model::EnumDefinition : public model::generated::EnumDefinition { diff --git a/include/revng/Model/EnumEntry.h b/include/revng/Model/EnumEntry.h index c086bf096..37c404239 100644 --- a/include/revng/Model/EnumEntry.h +++ b/include/revng/Model/EnumEntry.h @@ -6,29 +6,6 @@ #include "revng/ADT/SortedVector.h" -/* TUPLE-TREE-YAML -name: EnumEntry -doc: An entry in an `enum`. -type: struct -fields: - - name: Value - doc: |- - The value associated to this `enum` entry. - - Has to be unique within the `enum`. - type: uint64_t - - name: Name - type: string - optional: true - doc: |- - A user-chosen `Identifier` for this `enum` entry. - - name: Comment - type: string - optional: true -key: - - Value -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/EnumEntry.h" namespace model { diff --git a/include/revng/Model/Function.h b/include/revng/Model/Function.h index 917a4ee0d..47f4eda4c 100644 --- a/include/revng/Model/Function.h +++ b/include/revng/Model/Function.h @@ -15,64 +15,6 @@ #include "revng/Support/MetaAddress/YAMLTraits.h" #include "revng/TupleTree/TupleTree.h" -/* TUPLE-TREE-YAML -name: Function -doc: A function defined within this binary. -type: struct -fields: - - name: Entry - doc: | - The address of the entry point. - - Note: this does not necessarily correspond to the address of the basic - block with the lowest address. - type: MetaAddress - - name: Name - type: string - optional: true - - name: Comment - type: string - optional: true - - name: StackFrameType - doc: The type of the stack frame. - type: Type - upcastable: true - optional: true - - name: Prototype - doc: The prototype of the function. - type: Type - upcastable: true - optional: true - - name: Attributes - doc: Attributes for this call site. - sequence: - type: MutableSet - elementType: FunctionAttribute - optional: true - - name: CallSitePrototypes - doc: |- - Information about specific call sites within this function. - sequence: - type: SortedVector - elementType: CallSitePrototype - optional: true - - name: ExportedNames - doc: |- - The list of names used to make this function available as a dynamic - symbol. - sequence: - type: SortedVector - elementType: string - optional: true - - name: Comments - sequence: - type: vector - elementType: StatementComment - optional: true -key: - - Entry -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Function.h" namespace model { diff --git a/include/revng/Model/FunctionAttribute.h b/include/revng/Model/FunctionAttribute.h index b9e9d090b..eeb7e52db 100644 --- a/include/revng/Model/FunctionAttribute.h +++ b/include/revng/Model/FunctionAttribute.h @@ -4,17 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: FunctionAttribute -doc: | - Attributes for functions. Can be applied both to functions and call sites. -type: enum -members: - - name: NoReturn - doc: The function does not return. - - name: Inline - doc: The function must be inlined in callers. -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/FunctionAttribute.h" + #include "revng/Model/Generated/Late/FunctionAttribute.h" diff --git a/include/revng/Model/NamedTypedRegister.h b/include/revng/Model/NamedTypedRegister.h index a2e657a35..7d9b9a748 100644 --- a/include/revng/Model/NamedTypedRegister.h +++ b/include/revng/Model/NamedTypedRegister.h @@ -7,29 +7,6 @@ #include "revng/ADT/RecursiveCoroutine.h" #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: NamedTypedRegister -type: struct -doc: |- - An argument or return values in a `RawFunctionDefinition`. - - It is basically a pair of a register and a `Type`. -fields: - - name: Location - type: Register - - name: Type - type: Type - upcastable: true - - name: Name - type: string - optional: true - - name: Comment - type: string - optional: true -key: - - Location -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/NamedTypedRegister.h" namespace model { diff --git a/include/revng/Model/NamingConfiguration.h b/include/revng/Model/NamingConfiguration.h index 1f96a4765..b67049605 100644 --- a/include/revng/Model/NamingConfiguration.h +++ b/include/revng/Model/NamingConfiguration.h @@ -4,180 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML - -name: NamingConfiguration -type: struct -fields: - - name: UnnamedSegmentPrefix - doc: | - The prefix for a segment without a name. - - The default value is `segment_`. - type: string - optional: true - - - name: UnnamedDynamicFunctionPrefix - doc: | - The prefix for a dynamic function with an invalid name. - - The default value is `dynamic_function_`. - type: string - optional: true - - - name: UnnamedFunctionPrefix - doc: | - The prefix for a local function without a name. - - The default value is `function_`. - type: string - optional: true - - - name: UnnamedTypeDefinitionPrefix - doc: | - The prefix for a type definition without a name. - - The default value is "". - - Note that the type kind (like `struct`, or `typedef`) is going to be - inserted automatically after this prefix. - type: string - optional: true - - - name: UnnamedEnumEntryPrefix - doc: | - The prefix for an enum entry without a name. - - The default value is `enum_entry_`. - type: string - optional: true - - name: UnnamedStructFieldPrefix - doc: | - The prefix for a struct field without a name. - - The default value is `offset_`. - type: string - optional: true - - name: UnnamedUnionFieldPrefix - doc: | - The prefix for a union member without a name. - - The default value is `member_`. - type: string - optional: true - - - name: UnnamedFunctionArgumentPrefix - doc: | - The prefix for a cabi function argument without a name. - - The default value is `argument_`. - type: string - optional: true - - name: UnnamedFunctionRegisterPrefix - doc: | - The prefix for a raw function register without a name. - - The default value is `register_`. - type: string - optional: true - - - name: UnnamedLocalVariablePrefix - doc: | - The prefix for a local variable without a name. - - The default value is `var_`. - type: string - optional: true - - name: UnnamedBreakFromLoopVariablePrefix - doc: | - The prefix for a local variable without a name. - - The default value is `break_from_loop_`. - type: string - optional: true - - name: UndefinedValuePrefix - doc: | - The prefix for an undefined value. - - The default value is `undef_`. - type: string - optional: true - - name: OpaqueCSVValuePrefix - doc: | - The prefix for accessing an opaque CSV Value. - - The default value is `undef_`. - type: string - optional: true - - name: MaximumEnumValuePrefix - doc: | - The prefix for the maximum enum value. - - The default value is `enum_max_value_`. - type: string - optional: true - - - name: StackFrameVariableName - doc: | - The name of the variable representing stack. - - The default value is `stack`. - type: string - optional: true - - name: RawStackArgumentName - doc: | - The name of the variable representing stack. - - The default value is `stack_arguments`. - type: string - optional: true - - name: LoopStateVariableName - doc: | - The name of the variable representing stack. - - The default value is `loop_state_var`. - type: string - optional: true - - - name: StructPaddingPrefix - doc: | - The prefix for a padding struct field. - - The default value is `padding_at_`. - type: string - optional: true - - name: ArtificialReturnValuePrefix - doc: | - The prefix for an artificial raw function return value. - - The default value is `artificial_struct_returned_by_`. - type: string - optional: true - - name: ArtificialArrayWrapperPrefix - doc: | - The prefix for an artificial array wrapper. - - The default value is `artificial_wrapper_`. - type: string - optional: true - - name: ArtificialArrayWrapperFieldName - doc: | - The name of the field within the artificial array wrapper. - See `ArtificialArrayWrapperPrefix`. - - The default value is `the_array`. - type: string - optional: true - - - name: ReserveNamesStartingWithUnderscore - doc: | - When this is set to `true`, all the names starting with underscores will - have a \ref ReservedNamePrefix prefix attached. - type: bool - optional: true - -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/NamingConfiguration.h" class model::NamingConfiguration diff --git a/include/revng/Model/PointerType.h b/include/revng/Model/PointerType.h index 7fc852009..27a86b459 100644 --- a/include/revng/Model/PointerType.h +++ b/include/revng/Model/PointerType.h @@ -7,21 +7,6 @@ #include "revng/Model/Architecture.h" #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: PointerType -type: struct -inherits: Type -doc: A pointer type. -fields: - - name: PointerSize - doc: As of now, only 4 and 8 byte pointers are supported. - type: uint64_t - - name: PointeeType - type: Type - doc: The pointee type. - upcastable: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/PointerType.h" class model::PointerType : public model::generated::PointerType { diff --git a/include/revng/Model/PrimitiveKind.h b/include/revng/Model/PrimitiveKind.h index f38c9b1dd..3ddcb1204 100644 --- a/include/revng/Model/PrimitiveKind.h +++ b/include/revng/Model/PrimitiveKind.h @@ -6,34 +6,6 @@ #include "llvm/ADT/StringRef.h" -/* TUPLE-TREE-YAML -name: PrimitiveKind -type: enum -members: - - name: Void - doc: The `void` type. - - name: Generic - doc: |- - The most generic primitive kind: it can be any of the other primitive - kinds, except for `Void`. - - name: PointerOrNumber - doc: |- - A kind representing either a `Number` kind or a pointer. - This can also be seen as not-a-`Float`. - - name: Number - doc: |- - A two's complement integer number, either `Signed` or `Unsigned`. - - name: Unsigned - doc: |- - An `unsigned` two's complement integer number. - - name: Signed - doc: |- - An `signed` two's complement integer number. - - name: Float - doc: |- - A IEEE 754 floating point number. -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/PrimitiveKind.h" namespace model::PrimitiveKind { diff --git a/include/revng/Model/PrimitiveType.h b/include/revng/Model/PrimitiveType.h index f7c678d34..68ad7c0ad 100644 --- a/include/revng/Model/PrimitiveType.h +++ b/include/revng/Model/PrimitiveType.h @@ -7,30 +7,6 @@ #include "revng/Model/Register.h" #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: PrimitiveType -type: struct -inherits: Type -fields: - - name: PrimitiveKind - type: PrimitiveKind - - name: Size - doc: | - As of now, for floating point primitives, supported sizes include: - ``` - { 2, 4, 8, 10, 12, 16 } - ``` - For non-floating point, they are: - ``` - { 1, 2, 4, 8, 16 } - ``` - - Note that `Void` *must* have size of 0 while `Generic` can use all the - supported sizes, floating point or not. - type: uint64_t - optional: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/PrimitiveType.h" class model::PrimitiveType : public model::generated::PrimitiveType { diff --git a/include/revng/Model/RawFunctionDefinition.h b/include/revng/Model/RawFunctionDefinition.h index 4c7a5b14d..a8370c598 100644 --- a/include/revng/Model/RawFunctionDefinition.h +++ b/include/revng/Model/RawFunctionDefinition.h @@ -7,75 +7,6 @@ #include "revng/Model/NamedTypedRegister.h" #include "revng/Model/TypeDefinition.h" -/* TUPLE-TREE-YAML -name: RawFunctionDefinition -type: struct -inherits: TypeDefinition -doc: |- - The function type described by explicitly listing how arguments and return - values are passed. - - This is a "low level" representation of the prototype of a function. Where - the list of registers used to pass arguments and return values is explicitl. - For stack arguments, they are collected in a single `struct` - (`StackArgumentsType`). - - In contrast, a `CABIFunctionDefinition` expresses the function type from a - high-level perspective (e.g., a single argument might span multiple registers) - and his associated to a well-known ABI. Given an ABI, it is always possible - to convert a `CABIFunctionDefinition` into a `RawFunctionDefinition`. -fields: - - name: Architecture - type: Architecture - doc: The processor architecture of this function type. - - name: Arguments - optional: true - sequence: - type: SortedVector - elementType: NamedTypedRegister - doc: |- - The list of registers used to pass arguments. - - The registers must belong to `Architecture`. - - name: ReturnValues - optional: true - sequence: - type: SortedVector - elementType: NamedTypedRegister - doc: |- - The list of registers used to return values. - - The registers must belong to `Architecture`. - - name: ReturnValueComment - type: string - optional: true - - name: PreservedRegisters - optional: true - sequence: - type: SortedVector - elementType: Register - doc: |- - The list of registers preserved by functions using this function type. - - The registers must belong to `Architecture`. - - name: FinalStackOffset - type: uint64_t - optional: true - doc: |- - The expected difference between the initial and final value of the stack - pointer. - - For instance, in the x86-64 SystemV ABI, the difference between the - initial and final value of the stack pointer is 8. - This is due to the fact that `ret` instruction increase the stack pointer - by 8. - - name: StackArgumentsType - doc: The type of the `struct` representing all of the stack arguments. - type: Type - optional: true - upcastable: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/RawFunctionDefinition.h" class model::RawFunctionDefinition diff --git a/include/revng/Model/Register.h b/include/revng/Model/Register.h index b3793679d..b5ac47bce 100644 --- a/include/revng/Model/Register.h +++ b/include/revng/Model/Register.h @@ -15,240 +15,6 @@ #include "revng/Support/Generator.h" #include "revng/Support/YAMLTraits.h" -/* TUPLE-TREE-YAML -name: Register -type: enum -members: - # x86 registers - - name: eax_x86 - - name: ebx_x86 - - name: ecx_x86 - - name: edx_x86 - - name: esi_x86 - - name: edi_x86 - - name: ebp_x86 - - name: esp_x86 - - name: st0_x86 - - name: xmm0_x86 - - name: xmm1_x86 - - name: xmm2_x86 - - name: xmm3_x86 - - name: xmm4_x86 - - name: xmm5_x86 - - name: xmm6_x86 - - name: xmm7_x86 - # x86-64 registers - - name: rax_x86_64 - - name: rbx_x86_64 - - name: rcx_x86_64 - - name: rdx_x86_64 - - name: rbp_x86_64 - - name: rsp_x86_64 - - name: rsi_x86_64 - - name: rdi_x86_64 - - name: r8_x86_64 - - name: r9_x86_64 - - name: r10_x86_64 - - name: r11_x86_64 - - name: r12_x86_64 - - name: r13_x86_64 - - name: r14_x86_64 - - name: r15_x86_64 - - name: xmm0_x86_64 - - name: xmm1_x86_64 - - name: xmm2_x86_64 - - name: xmm3_x86_64 - - name: xmm4_x86_64 - - name: xmm5_x86_64 - - name: xmm6_x86_64 - - name: xmm7_x86_64 - - name: fs_x86_64 - # ARM registers - - name: r0_arm - - name: r1_arm - - name: r2_arm - - name: r3_arm - - name: r4_arm - - name: r5_arm - - name: r6_arm - - name: r7_arm - - name: r8_arm - - name: r9_arm - - name: r10_arm - - name: r11_arm - - name: r12_arm - - name: r13_arm - - name: r14_arm - - name: r15_arm - - name: q0_arm - - name: q1_arm - - name: q2_arm - - name: q3_arm - - name: q4_arm - - name: q5_arm - - name: q6_arm - - name: q7_arm - # AArch64 registers - - name: x0_aarch64 - - name: x1_aarch64 - - name: x2_aarch64 - - name: x3_aarch64 - - name: x4_aarch64 - - name: x5_aarch64 - - name: x6_aarch64 - - name: x7_aarch64 - - name: x8_aarch64 - - name: x9_aarch64 - - name: x10_aarch64 - - name: x11_aarch64 - - name: x12_aarch64 - - name: x13_aarch64 - - name: x14_aarch64 - - name: x15_aarch64 - - name: x16_aarch64 - - name: x17_aarch64 - - name: x18_aarch64 - - name: x19_aarch64 - - name: x20_aarch64 - - name: x21_aarch64 - - name: x22_aarch64 - - name: x23_aarch64 - - name: x24_aarch64 - - name: x25_aarch64 - - name: x26_aarch64 - - name: x27_aarch64 - - name: x28_aarch64 - - name: x29_aarch64 - - name: lr_aarch64 - - name: sp_aarch64 - - name: v0_aarch64 - - name: v1_aarch64 - - name: v2_aarch64 - - name: v3_aarch64 - - name: v4_aarch64 - - name: v5_aarch64 - - name: v6_aarch64 - - name: v7_aarch64 - - name: v8_aarch64 - - name: v9_aarch64 - - name: v10_aarch64 - - name: v11_aarch64 - - name: v12_aarch64 - - name: v13_aarch64 - - name: v14_aarch64 - - name: v15_aarch64 - - name: v16_aarch64 - - name: v17_aarch64 - - name: v18_aarch64 - - name: v19_aarch64 - - name: v20_aarch64 - - name: v21_aarch64 - - name: v22_aarch64 - - name: v23_aarch64 - - name: v24_aarch64 - - name: v25_aarch64 - - name: v26_aarch64 - - name: v27_aarch64 - - name: v28_aarch64 - - name: v29_aarch64 - - name: v30_aarch64 - - name: v31_aarch64 - # MIPS registers - - name: v0_mips - - name: v1_mips - - name: a0_mips - - name: a1_mips - - name: a2_mips - - name: a3_mips - - name: s0_mips - - name: s1_mips - - name: s2_mips - - name: s3_mips - - name: s4_mips - - name: s5_mips - - name: s6_mips - - name: s7_mips - - name: t0_mips - - name: t1_mips - - name: t2_mips - - name: t3_mips - - name: t4_mips - - name: t5_mips - - name: t6_mips - - name: t7_mips - - name: t8_mips - - name: t9_mips - - name: gp_mips - - name: sp_mips - - name: fp_mips - - name: ra_mips - - name: f0_mips - - name: f1_mips - - name: f2_mips - - name: f3_mips - - name: f4_mips - - name: f5_mips - - name: f6_mips - - name: f7_mips - - name: f8_mips - - name: f9_mips - - name: f10_mips - - name: f11_mips - - name: f12_mips - - name: f13_mips - - name: f14_mips - - name: f15_mips - - name: f16_mips - - name: f17_mips - - name: f18_mips - - name: f19_mips - - name: f20_mips - - name: f21_mips - - name: f22_mips - - name: f23_mips - - name: f24_mips - - name: f25_mips - - name: f26_mips - - name: f27_mips - - name: f28_mips - - name: f29_mips - - name: f30_mips - - name: f31_mips - # SystemZ registers - - name: r0_systemz - - name: r1_systemz - - name: r2_systemz - - name: r3_systemz - - name: r4_systemz - - name: r5_systemz - - name: r6_systemz - - name: r7_systemz - - name: r8_systemz - - name: r9_systemz - - name: r10_systemz - - name: r11_systemz - - name: r12_systemz - - name: r13_systemz - - name: r14_systemz - - name: r15_systemz - - name: f0_systemz - - name: f1_systemz - - name: f2_systemz - - name: f3_systemz - - name: f4_systemz - - name: f5_systemz - - name: f6_systemz - - name: f7_systemz - - name: f8_systemz - - name: f9_systemz - - name: f10_systemz - - name: f11_systemz - - name: f12_systemz - - name: f13_systemz - - name: f14_systemz - - name: f15_systemz -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Register.h" namespace model::Register { diff --git a/include/revng/Model/Relocation.h b/include/revng/Model/Relocation.h index 03addf669..cafc06e63 100644 --- a/include/revng/Model/Relocation.h +++ b/include/revng/Model/Relocation.h @@ -8,31 +8,6 @@ #include "revng/Support/MetaAddress.h" #include "revng/Support/MetaAddress/YAMLTraits.h" -/* TUPLE-TREE-YAML -name: Relocation -type: struct -doc: |- - A relocation, i.e., a directive to write the address of an object (a - `DynamicFunction` or a `Segment`) at a specific address. - Optionally, the address of the object can be modified with a constant offset. -fields: - - name: Address - type: MetaAddress - doc: Where to write the address of the object. - - name: Type - type: RelocationType - doc: |- - How to write the address of the object (e.g., 32-bit vs 64-bit - integer). - - name: Addend - type: uint64_t - doc: Fixed offset to add when writing the address of the object. - -key: - - Address - - Type -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Relocation.h" namespace model { diff --git a/include/revng/Model/RelocationType.h b/include/revng/Model/RelocationType.h index d235c5d51..689360efa 100644 --- a/include/revng/Model/RelocationType.h +++ b/include/revng/Model/RelocationType.h @@ -6,43 +6,6 @@ #include "revng/Model/Architecture.h" -/* TUPLE-TREE-YAML -name: RelocationType -doc: |- - A enumeration describing how a `Relocation` should be written at the target - address. -type: enum -members: - - name: WriteAbsoluteAddress32 - doc: Write the absolute address of the object as a 32-bit integer. - - name: WriteAbsoluteAddress64 - doc: Write the absolute address of the object as a 64-bit integer. - - name: AddAbsoluteAddress32 - doc: |- - Add to the 32-bit integer present at the target location the absolute - address of the object. - - name: AddAbsoluteAddress64 - doc: |- - Add to the 64-bit integer present at the target location the absolute - address of the object. - - name: WriteRelativeAddress32 - doc: |- - Write the address of the object as a 32-bit integer, expressed as a - relative from the target of the relocation. - - name: WriteRelativeAddress64 - doc: |- - Write the address of the object as a 64-bit integer, expressed as a - relative from the target of the relocation. - - name: AddRelativeAddress32 - doc: |- - Add to the 32-bit integer present at the target location the address of - the object, expressed as a relative from the target of the relocation. - - name: AddRelativeAddress64 - doc: |- - Add to the 32-bit integer present at the target location the address of - the object, expressed as a relative from the target of the relocation. -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/RelocationType.h" constexpr unsigned char R_MIPS_IMPLICIT_RELATIVE = 255; diff --git a/include/revng/Model/Segment.h b/include/revng/Model/Segment.h index f0c0d83b2..c3bf6ca10 100644 --- a/include/revng/Model/Segment.h +++ b/include/revng/Model/Segment.h @@ -10,66 +10,6 @@ #include "revng/Support/MetaAddress.h" #include "revng/Support/MetaAddress/YAMLTraits.h" -/* TUPLE-TREE-YAML -name: Segment -type: struct -doc: |- - A segment contains the information necessary for rev.ng to load the executable - in memory. -fields: - - name: StartAddress - type: MetaAddress - doc: The address at which this segment should be loaded. - - name: VirtualSize - type: uint64_t - doc: |- - The size of the segment in memory. - If this value is greater than `FileSize`, the discrepancy is considered to - full of `00`. - - name: StartOffset - type: uint64_t - doc: Start file offset from which the segment will be loaded. - - name: FileSize - type: uint64_t - doc: Number of bytes that will be loaded in memory from the file. - - name: IsReadable - type: bool - doc: Is this segment readable? - - name: IsWriteable - type: bool - doc: Is this segment writable? - - name: IsExecutable - type: bool - - name: Name - type: string - optional: true - - name: Comment - type: string - optional: true - - name: CanonicalRegisterValues - optional: true - sequence: - type: SortedVector - elementType: CanonicalRegisterValue - - name: Relocations - optional: true - sequence: - type: SortedVector - elementType: Relocation - - name: Type - doc: The type of the segment - type: Type - upcastable: true - optional: true - doc: |- - The `StructDefinition` associated to this segment. - Informally, each field of such `struct` is a global variable. - -key: - - StartAddress - - VirtualSize -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Segment.h" namespace model { diff --git a/include/revng/Model/StatementComment.h b/include/revng/Model/StatementComment.h index ec9a324f3..941d02885 100644 --- a/include/revng/Model/StatementComment.h +++ b/include/revng/Model/StatementComment.h @@ -6,36 +6,6 @@ #include "revng/Support/MetaAddress.h" -/* TUPLE-TREE-YAML - -name: StatementComment -type: struct - -fields: - - name: Location - doc: | - The point this comment is attached to, encoded as a set of addresses. - - When emitted artifact contains a statement with a set of addresses exactly - matching the set provided here, the comment is emitted before that - statement. - - If there's no such statement, one is chosen based on how similar its - address set is to the address set of the comment. - - Note that the same comment can be emitted multiple times if there are - multiple statements (that do *not* dominate each other) with the same - address set. - - sequence: - type: SortedVector - elementType: MetaAddress - - - name: Body - type: string - -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/StatementComment.h" class model::StatementComment : public model::generated::StatementComment { diff --git a/include/revng/Model/StructDefinition.h b/include/revng/Model/StructDefinition.h index 39e3cc3c8..24dccbf07 100644 --- a/include/revng/Model/StructDefinition.h +++ b/include/revng/Model/StructDefinition.h @@ -7,30 +7,6 @@ #include "revng/Model/StructField.h" #include "revng/Model/TypeDefinition.h" -/* TUPLE-TREE-YAML -name: StructDefinition -doc: | - A `struct` type. -type: struct -inherits: TypeDefinition -fields: - - name: Size - doc: The size, in bytes, of the `struct`. - type: uint64_t - - name: CanContainCode - doc: | - When this field is set to `true` *and* this `struct` is reachable for - a segment's root type without traversing pointer, arrays or other - qualifiers, the padding of the struct is treated at if it contains code. - type: bool - optional: true - - name: Fields - doc: The list of fields of this `struct`. - sequence: - type: SortedVector - elementType: StructField -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/StructDefinition.h" class model::StructDefinition : public model::generated::StructDefinition { diff --git a/include/revng/Model/StructField.h b/include/revng/Model/StructField.h index 84a077855..f41d3a91c 100644 --- a/include/revng/Model/StructField.h +++ b/include/revng/Model/StructField.h @@ -7,30 +7,6 @@ #include "revng/ADT/RecursiveCoroutine.h" #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: StructField -doc: |- - A field of a `StructDefinition`. - - It is composed by the offset of the field and its type. -type: struct -fields: - - name: Offset - type: uint64_t - - name: Name - type: string - optional: true - - name: Comment - type: string - optional: true - - name: Type - type: Type - doc: The type of the field. - upcastable: true -key: - - Offset -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/StructField.h" namespace model { diff --git a/include/revng/Model/Type.h b/include/revng/Model/Type.h index f7c8b8772..3c497c597 100644 --- a/include/revng/Model/Type.h +++ b/include/revng/Model/Type.h @@ -9,20 +9,6 @@ #include "revng/Model/CommonTypeMethods.h" #include "revng/Model/TypeDefinition.h" -/* TUPLE-TREE-YAML -name: Type -doc: |- - A type such as an array, a pointer, a primitive or a defined type. -type: struct -fields: - - name: Kind - type: TypeKind - - name: IsConst - type: bool - optional: true -abstract: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/Type.h" class model::Type : public model::generated::Type, diff --git a/include/revng/Model/TypeDefinition.h b/include/revng/Model/TypeDefinition.h index 58a592223..2951762a9 100644 --- a/include/revng/Model/TypeDefinition.h +++ b/include/revng/Model/TypeDefinition.h @@ -19,41 +19,6 @@ #include "revng/Support/YAMLTraits.h" #include "revng/TupleTree/TupleTree.h" -/* TUPLE-TREE-YAML -name: TypeDefinition -doc: |- - Base data structure for all the type definitions. - - A type definition differs from a `Type` in the fact that it has an identity. - In fact, while two identical instances of `Type` can be considered to be the - same `Type`, two instances of a `TypeDefinition` that only differ from their - `ID` are two distinct types. - - A type definition can be a `struct`, a `union`, a `typedef`, an `enum` or a - function prototype. -type: struct -fields: - - name: ID - type: uint64_t - is_guid: true - doc: |- - A unique identifier for this type. - - name: Kind - type: TypeDefinitionKind - - name: Name - doc: |- - A user-chosen `Identifier` for this type. - type: string - optional: true - - name: Comment - type: string - optional: true -key: - - ID - - Kind -abstract: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/TypeDefinition.h" class model::TypeDefinition : public model::generated::TypeDefinition, diff --git a/include/revng/Model/TypeKind.h b/include/revng/Model/TypeKind.h index afd5c7cc2..279a301a5 100644 --- a/include/revng/Model/TypeKind.h +++ b/include/revng/Model/TypeKind.h @@ -5,4 +5,5 @@ // #include "revng/Model/Generated/Early/TypeKind.h" + #include "revng/Model/Generated/Late/TypeKind.h" diff --git a/include/revng/Model/TypedefDefinition.h b/include/revng/Model/TypedefDefinition.h index 438502a32..2088c7416 100644 --- a/include/revng/Model/TypedefDefinition.h +++ b/include/revng/Model/TypedefDefinition.h @@ -7,22 +7,6 @@ #include "revng/Model/Type.h" #include "revng/Model/TypeDefinition.h" -/* TUPLE-TREE-YAML -name: TypedefDefinition -doc: |- - A `typedef` type. - - Note, that unlike in C, two `typedef`s aliasing the same type are actually - distinct types. -type: struct -inherits: TypeDefinition -fields: - - name: UnderlyingType - type: Type - doc: The type this `typedef` is aliasing. - upcastable: true -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/TypedefDefinition.h" class model::TypedefDefinition : public model::generated::TypedefDefinition { diff --git a/include/revng/Model/UnionDefinition.h b/include/revng/Model/UnionDefinition.h index 13616bfd0..f82cfff74 100644 --- a/include/revng/Model/UnionDefinition.h +++ b/include/revng/Model/UnionDefinition.h @@ -7,20 +7,6 @@ #include "revng/Model/TypeDefinition.h" #include "revng/Model/UnionField.h" -/* TUPLE-TREE-YAML -name: UnionDefinition -doc: | - A `union` type. -type: struct -inherits: TypeDefinition -fields: - - name: Fields - doc: The list of alternative types in this `union`. - sequence: - type: SortedVector - elementType: UnionField -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/UnionDefinition.h" class model::UnionDefinition : public model::generated::UnionDefinition { diff --git a/include/revng/Model/UnionField.h b/include/revng/Model/UnionField.h index 5ddb1b0ea..21b6126bb 100644 --- a/include/revng/Model/UnionField.h +++ b/include/revng/Model/UnionField.h @@ -7,30 +7,6 @@ #include "revng/ADT/RecursiveCoroutine.h" #include "revng/Model/Type.h" -/* TUPLE-TREE-YAML -name: UnionField -doc: |- - An alternative of a `UnionDefinition`. - - It is composed by a index and the `Type`. -type: struct -fields: - - name: Index - type: uint64_t - - name: Name - type: string - optional: true - - name: Comment - type: string - optional: true - - name: Type - type: Type - doc: The type of this `union` alternative. - upcastable: true -key: - - Index -TUPLE-TREE-YAML */ - #include "revng/Model/Generated/Early/UnionField.h" namespace model { diff --git a/include/revng/Pipeline/Description/AnalysesList.h b/include/revng/Pipeline/Description/AnalysesList.h index fc86673dc..e207b0580 100644 --- a/include/revng/Pipeline/Description/AnalysesList.h +++ b/include/revng/Pipeline/Description/AnalysesList.h @@ -4,23 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: AnalysesList -doc: Data structure representing a list of analyses -type: struct -fields: - - name: Name - doc: AnalysesList's name - type: string - - name: Analyses - doc: AnalysesList's list of analyses - sequence: - type: SortedVector - elementType: AnalysisReference -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/AnalysesList.h" class pipeline::description::AnalysesList diff --git a/include/revng/Pipeline/Description/Analysis.h b/include/revng/Pipeline/Description/Analysis.h index 446d86b2a..fc152a1ad 100644 --- a/include/revng/Pipeline/Description/Analysis.h +++ b/include/revng/Pipeline/Description/Analysis.h @@ -4,28 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: Analysis -doc: Data structure representing an analysis -type: struct -fields: - - name: Name - doc: Analysis' name - type: string - - name: ContainerInputs - doc: Analysis' container inputs - sequence: - type: SortedVector - elementType: AnalysisContainerInput - - name: Options - doc: Analysis' options - sequence: - type: SortedVector - elementType: AnalysisOption -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/Analysis.h" class pipeline::description::Analysis diff --git a/include/revng/Pipeline/Description/AnalysisContainerInput.h b/include/revng/Pipeline/Description/AnalysisContainerInput.h index 93b40b34a..bdb617f88 100644 --- a/include/revng/Pipeline/Description/AnalysisContainerInput.h +++ b/include/revng/Pipeline/Description/AnalysisContainerInput.h @@ -4,23 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: AnalysisContainerInput -doc: Data structure representing an analysis' container input -type: struct -fields: - - name: Name - doc: AnalysisContainerInput' name - type: string - - name: AcceptableKinds - doc: Kinds accepted by the analysis - sequence: - type: SortedVector - elementType: string -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/AnalysisContainerInput.h" class pipeline::description::AnalysisContainerInput diff --git a/include/revng/Pipeline/Description/AnalysisOption.h b/include/revng/Pipeline/Description/AnalysisOption.h index b6ddc540a..dbcbb6268 100644 --- a/include/revng/Pipeline/Description/AnalysisOption.h +++ b/include/revng/Pipeline/Description/AnalysisOption.h @@ -4,21 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: AnalysisOption -doc: Data structure representing an analysis' container input -type: struct -fields: - - name: Name - doc: AnalysisOption' name - type: string - - name: Type - doc: Type of the option - type: string -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/AnalysisOption.h" class pipeline::description::AnalysisOption diff --git a/include/revng/Pipeline/Description/AnalysisReference.h b/include/revng/Pipeline/Description/AnalysisReference.h index f098faa65..6b37e18f0 100644 --- a/include/revng/Pipeline/Description/AnalysisReference.h +++ b/include/revng/Pipeline/Description/AnalysisReference.h @@ -4,22 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: AnalysisReference -doc: A reference to an analysis -type: struct -fields: - - name: Step - doc: The step where the analysis belongs to - type: string - - name: Name - doc: The name of the analysis - type: string -key: - - Step - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/AnalysisReference.h" class pipeline::description::AnalysisReference diff --git a/include/revng/Pipeline/Description/Artifacts.h b/include/revng/Pipeline/Description/Artifacts.h index 2db732259..268146526 100644 --- a/include/revng/Pipeline/Description/Artifacts.h +++ b/include/revng/Pipeline/Description/Artifacts.h @@ -4,25 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: Artifacts -doc: Data structure representing a Artifacts -type: struct -fields: - - name: Kind - doc: Artifacts's kind - type: string - optional: true - - name: Container - doc: Artifacts's container - type: string - optional: true - - name: SingleTargetFilename - doc: The Artifacts's filename to use for a single element - type: string - optional: true -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/Artifacts.h" class pipeline::description::Artifacts diff --git a/include/revng/Pipeline/Description/Container.h b/include/revng/Pipeline/Description/Container.h index e6ca0b2ad..ca30d0ee3 100644 --- a/include/revng/Pipeline/Description/Container.h +++ b/include/revng/Pipeline/Description/Container.h @@ -4,21 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: Container -doc: Data structure representing a Container -type: struct -fields: - - name: Name - doc: Container's name - type: string - - name: MIMEType - doc: Container's mime type - type: string -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/Container.h" class pipeline::description::Container diff --git a/include/revng/Pipeline/Description/Kind.h b/include/revng/Pipeline/Description/Kind.h index 770233547..ce8f23384 100644 --- a/include/revng/Pipeline/Description/Kind.h +++ b/include/revng/Pipeline/Description/Kind.h @@ -4,37 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: Kind -doc: Data structure representing a Kind -type: struct -fields: - - name: Name - doc: Kind's name - type: string - - name: Rank - doc: Kind's rank - type: string - - name: Parent - doc: The Kind's parent (if present) - type: string - optional: true - - name: DefinedLocations - doc: List of locations that the Kind provides - sequence: - type: SortedVector - elementType: string - - name: PreferredKinds - doc: > - These are the kinds that should be looked into in order to find - definitions to locations that are not present in the current document - sequence: - type: SortedVector - elementType: string -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/Kind.h" class pipeline::description::Kind diff --git a/include/revng/Pipeline/Description/PipelineDescription.h b/include/revng/Pipeline/Description/PipelineDescription.h index 441086da9..49026c73e 100644 --- a/include/revng/Pipeline/Description/PipelineDescription.h +++ b/include/revng/Pipeline/Description/PipelineDescription.h @@ -4,41 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: PipelineDescription -doc: Data structure representing the structure of the pipeline -type: struct -fields: - - name: AnalysesLists - doc: AnalysesLists available in the pipeline - sequence: - type: SortedVector - elementType: AnalysesList - - name: Globals - doc: List of Globals - sequence: - type: SortedVector - elementType: string - - name: Kinds - doc: Kinds - sequence: - type: SortedVector - elementType: Kind - - name: Ranks - doc: Ranks - sequence: - type: SortedVector - elementType: Rank - - name: Containers - sequence: - type: SortedVector - elementType: Container - - name: Steps - sequence: - type: SortedVector - elementType: Step -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/PipelineDescription.h" class pipeline::description::PipelineDescription diff --git a/include/revng/Pipeline/Description/Rank.h b/include/revng/Pipeline/Description/Rank.h index b1fd0408a..52a539df2 100644 --- a/include/revng/Pipeline/Description/Rank.h +++ b/include/revng/Pipeline/Description/Rank.h @@ -4,25 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: Rank -doc: Data structure representing a Rank -type: struct -fields: - - name: Name - doc: Rank's name - type: string - - name: Depth - doc: Rank's depth - type: uint64_t - - name: Parent - doc: The Rank's parent (if present) - type: string - optional: true -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/Rank.h" class pipeline::description::Rank diff --git a/include/revng/Pipeline/Description/Step.h b/include/revng/Pipeline/Description/Step.h index 520e856bd..02d586b22 100644 --- a/include/revng/Pipeline/Description/Step.h +++ b/include/revng/Pipeline/Description/Step.h @@ -4,35 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: Step -doc: Data structure representing a Step -type: struct -fields: - - name: Name - doc: Step's name - type: string - - name: Component - doc: Step's component - type: string - optional: true - - name: Parent - doc: The Step's parent (if present) - type: string - optional: true - - name: Analyses - doc: List of Analyses that the Step provides - sequence: - type: SortedVector - elementType: Analysis - - name: Artifacts - doc: The artifacts that this step provides - type: Artifacts - optional: true -key: - - Name -TUPLE-TREE-YAML */ - #include "revng/Pipeline/Description/Generated/Early/Step.h" class pipeline::description::Step diff --git a/include/revng/Pipes/ModelGlobal.h b/include/revng/Pipes/ModelGlobal.h index d19381b67..ee30ede1c 100644 --- a/include/revng/Pipes/ModelGlobal.h +++ b/include/revng/Pipes/ModelGlobal.h @@ -8,8 +8,8 @@ #include "llvm/Support/raw_ostream.h" #include "revng/Model/Binary.h" -#include "revng/Model/Generated/Early/TypeDefinition.h" #include "revng/Model/LoadModelPass.h" +#include "revng/Model/TypeDefinition.h" #include "revng/Pipeline/ContainerSet.h" #include "revng/Pipeline/Context.h" #include "revng/Pipeline/Contract.h" diff --git a/include/revng/Yield/BasicBlock.h b/include/revng/Yield/BasicBlock.h index c66330f93..6be36b49f 100644 --- a/include/revng/Yield/BasicBlock.h +++ b/include/revng/Yield/BasicBlock.h @@ -15,63 +15,6 @@ #include "revng/Yield/FunctionEdgeBase.h" #include "revng/Yield/Instruction.h" -/* TUPLE-TREE-YAML - -name: BasicBlock -type: struct -fields: - - name: ID - type: BasicBlockID - - - name: End - doc: | - End address of the basic block, i.e., the address where the last - instruction ends - type: MetaAddress - - - name: InlinedFrom - type: MetaAddress - optional: true - doc: Address of the function this basic block has been inlined from - - - name: Label - type: TaggedString - - - name: Successors - doc: List of successor edges - sequence: - type: SortedVector - upcastable: true - elementType: FunctionEdgeBase - - - name: Instructions - sequence: - type: SortedVector - elementType: Instruction - - - name: IsLabelAlwaysRequired - doc: | - This flag is set to `false` for basic blocks that are never directly - pointed to, i.e. blocks that are only ever entered from the previous - instructions and such. - This lets us dynamically decide whether we want to show labels like this - or not. - type: bool - - - name: HasDelaySlot - doc: > - This flag is set if the last instruction of the block is in a delay slot - and is executed at the same time as the instruction preceding it. - \note: This is always equal to `false` on architectures that do not - support delay slots. - type: bool - optional: true - -key: - - ID - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/BasicBlock.h" namespace model { diff --git a/include/revng/Yield/CallEdge.h b/include/revng/Yield/CallEdge.h index 56c7ca8c7..59f68eaf9 100644 --- a/include/revng/Yield/CallEdge.h +++ b/include/revng/Yield/CallEdge.h @@ -9,34 +9,6 @@ #include "revng/Model/FunctionAttribute.h" #include "revng/Yield/FunctionEdge.h" -/* TUPLE-TREE-YAML -name: CallEdge -doc: A CFG edge to represent function calls (direct, indirect and tail calls) -type: struct -inherits: FunctionEdgeBase -fields: - - name: DynamicFunction - doc: | - Name of the dynamic function being called, or empty if not a dynamic call - type: string - optional: true - - name: IsTailCall - doc: Is this a tail call? - type: bool - optional: true - - name: Attributes - doc: | - Attributes for this function - - Note: To have the effective list of attributes for this call site, you - have to add attributes on the called function. - TODO: switch to std::set - sequence: - type: MutableSet - elementType: model::FunctionAttribute::Values - optional: true -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/CallEdge.h" namespace efa { diff --git a/include/revng/Yield/CrossRelations/CrossRelations.h b/include/revng/Yield/CrossRelations/CrossRelations.h index 0d0f5865d..c3d13a51a 100644 --- a/include/revng/Yield/CrossRelations/CrossRelations.h +++ b/include/revng/Yield/CrossRelations/CrossRelations.h @@ -10,16 +10,6 @@ #include "revng/Yield/CallGraphs/Graph.h" #include "revng/Yield/CrossRelations/RelationDescription.h" -/* TUPLE-TREE-YAML -name: CrossRelations -type: struct -fields: - - name: Relations - sequence: - type: SortedVector - elementType: RelationDescription -TUPLE-TREE-YAML */ - #include "revng/Yield/CrossRelations/Generated/Early/CrossRelations.h" namespace yield::crossrelations { diff --git a/include/revng/Yield/CrossRelations/RelationDescription.h b/include/revng/Yield/CrossRelations/RelationDescription.h index f776e7fe2..452a26b0e 100644 --- a/include/revng/Yield/CrossRelations/RelationDescription.h +++ b/include/revng/Yield/CrossRelations/RelationDescription.h @@ -6,23 +6,6 @@ #include "revng/ADT/SortedVector.h" -/* TUPLE-TREE-YAML - -name: RelationDescription -type: struct -fields: - - name: Location - type: string - - name: IsCalledFrom - sequence: - type: SortedVector - elementType: string - optional: true -key: - - Location - -TUPLE-TREE-YAML */ - #include "revng/Yield/CrossRelations/Generated/Early/RelationDescription.h" namespace yield::crossrelations { diff --git a/include/revng/Yield/Function.h b/include/revng/Yield/Function.h index d03105b8b..44e59a1cf 100644 --- a/include/revng/Yield/Function.h +++ b/include/revng/Yield/Function.h @@ -12,24 +12,6 @@ #include "revng/Support/MetaAddress/YAMLTraits.h" #include "revng/Yield/BasicBlock.h" -/* TUPLE-TREE-YAML - -name: Function -type: struct -fields: - - name: Entry - type: MetaAddress - - - name: Blocks - sequence: - type: SortedVector - elementType: BasicBlock - -key: - - Entry - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/Function.h" namespace model { diff --git a/include/revng/Yield/FunctionEdge.h b/include/revng/Yield/FunctionEdge.h index f2feee6e4..f29a00c6b 100644 --- a/include/revng/Yield/FunctionEdge.h +++ b/include/revng/Yield/FunctionEdge.h @@ -6,14 +6,6 @@ #include "revng/Yield/FunctionEdgeBase.h" -/* TUPLE-TREE-YAML -name: FunctionEdge -doc: An edge on the CFG -type: struct -inherits: FunctionEdgeBase -fields: [] -TUPLE-TREE-YAML */ - namespace efa { class FunctionEdge; } diff --git a/include/revng/Yield/FunctionEdgeBase.h b/include/revng/Yield/FunctionEdgeBase.h index 9b285d935..8988f7209 100644 --- a/include/revng/Yield/FunctionEdgeBase.h +++ b/include/revng/Yield/FunctionEdgeBase.h @@ -9,33 +9,6 @@ #include "revng/Support/MetaAddress/YAMLTraits.h" #include "revng/Yield/FunctionEdgeType.h" -/* TUPLE-TREE-YAML -name: FunctionEdgeBase -doc: An edge on the CFG -type: struct -fields: - - name: Destination - optional: true - doc: | - Target of the CFG edge - - If invalid, it's an indirect edge such as a return instruction or an - indirect function call. - If valid, it's either the address of the basic block in case of a direct - branch, or, in case of a function call, the address of the callee. - TODO: switch to TupleTreeReference - type: BasicBlockID - - name: Kind - type: FunctionEdgeBaseKind - - name: Type - doc: Type of the CFG edge - type: FunctionEdgeType -key: - - Destination - - Kind -abstract: true -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/FunctionEdgeBase.h" namespace model { diff --git a/include/revng/Yield/FunctionEdgeType.h b/include/revng/Yield/FunctionEdgeType.h index f211d7f8d..20d805446 100644 --- a/include/revng/Yield/FunctionEdgeType.h +++ b/include/revng/Yield/FunctionEdgeType.h @@ -6,29 +6,6 @@ #include "revng/EarlyFunctionAnalysis/FunctionEdgeType.h" -/* TUPLE-TREE-YAML -name: FunctionEdgeType -doc: Type of edge on the CFG -type: enum -members: - - name: DirectBranch - doc: Branch due to function-local CFG (a regular branch) - - name: FunctionCall - doc: A function call for which the cache was able to produce a summary - - name: Return - doc: A proper function return - - name: BrokenReturn - doc: | - A branch returning to the return address, but leaving the stack in an - unexpected situation - - name: LongJmp - doc: A branch representing a longjmp or similar constructs - - name: Killer - doc: A killer basic block (killer syscall or endless loop) - - name: Unreachable - doc: The basic block ends with an unreachable instruction -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/FunctionEdgeType.h" // TODO: we need to handle noreturn function calls diff --git a/include/revng/Yield/Instruction.h b/include/revng/Yield/Instruction.h index 6068800ca..0eff56b90 100644 --- a/include/revng/Yield/Instruction.h +++ b/include/revng/Yield/Instruction.h @@ -17,57 +17,6 @@ namespace yield { using ByteContainer = llvm::SmallVector; } -/* TUPLE-TREE-YAML - -name: Instruction -type: struct -fields: - - name: Address - doc: > - Indicates the address of the first byte of the instruction. - type: MetaAddress - - - name: RawBytes - type: yield::ByteContainer - - - name: Disassembled - sequence: - type: SortedVector - elementType: TaggedString - - - name: PrecedingDirectives - sequence: - type: SortedVector - elementType: TaggedLine - - - name: FollowingDirectives - sequence: - type: SortedVector - elementType: TaggedLine - - - name: OpcodeIdentifier - type: string - optional: true - - - name: Comment - doc: > - Contains any extra information deduced based on the disassembly of this - instruction that could be relevant for the user. - type: string - optional: true - - - name: Error - doc: > - Contains any extra extra warning/error style information deduced based on - the disassembly of this instruction that could be relevant for the user. - type: string - optional: true - -key: - - Address - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/Instruction.h" namespace model { diff --git a/include/revng/Yield/TagAttribute.h b/include/revng/Yield/TagAttribute.h index 54eeafd53..2d8a0b91b 100644 --- a/include/revng/Yield/TagAttribute.h +++ b/include/revng/Yield/TagAttribute.h @@ -6,22 +6,6 @@ #include -/* TUPLE-TREE-YAML - -name: TagAttribute -type: struct -fields: - - name: Name - type: string - - - name: Value - type: string - -key: - - Name - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/TagAttribute.h" namespace yield { diff --git a/include/revng/Yield/TagType.h b/include/revng/Yield/TagType.h index 6ef22c833..3c65bf571 100644 --- a/include/revng/Yield/TagType.h +++ b/include/revng/Yield/TagType.h @@ -4,29 +4,6 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML - -name: TagType -doc: Enum for identifying different instruction markup tag types -type: enum -members: - - name: Untagged - - name: Helper - - name: Memory - - name: Register - - name: Immediate - - name: Address - - name: AbsoluteAddress - - name: PCRelativeAddress - - name: Mnemonic - - name: MnemonicPrefix - - name: MnemonicSuffix - - name: Directive - - name: Whitespace - - name: Label - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/TagType.h" namespace yield::TagType { diff --git a/include/revng/Yield/TaggedLine.h b/include/revng/Yield/TaggedLine.h index d9761d80c..99fedb7bf 100644 --- a/include/revng/Yield/TaggedLine.h +++ b/include/revng/Yield/TaggedLine.h @@ -6,24 +6,6 @@ #include "revng/Yield/TaggedString.h" -/* TUPLE-TREE-YAML - -name: TaggedLine -type: struct -fields: - - name: Index - type: uint64_t - - - name: Tags - sequence: - type: SortedVector - elementType: TaggedString - -key: - - Index - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/TaggedLine.h" namespace model { diff --git a/include/revng/Yield/TaggedString.h b/include/revng/Yield/TaggedString.h index 7523a08d3..65a0bef5f 100644 --- a/include/revng/Yield/TaggedString.h +++ b/include/revng/Yield/TaggedString.h @@ -10,30 +10,6 @@ #include "revng/Yield/TagType.h" -/* TUPLE-TREE-YAML - -name: TaggedString -type: struct -fields: - - name: Index - type: uint64_t - - - name: Type - type: TagType - - - name: Content - type: string - - - name: Attributes - sequence: - type: SortedVector - elementType: TagAttribute - optional: true -key: - - Index - -TUPLE-TREE-YAML */ - #include "revng/Yield/Generated/Early/TaggedString.h" namespace model { diff --git a/share/revng/clang-format-style-file.yml b/share/revng/clang-format-style-file.yml index 6ba78f690..9bb14ae3b 100644 --- a/share/revng/clang-format-style-file.yml +++ b/share/revng/clang-format-style-file.yml @@ -75,6 +75,8 @@ IncludeBlocks: Regroup, IncludeCategories: [ + { Regex: '^"revng.*/Generated/Late/', Priority: 0 }, + { Regex: '^"revng.*/Generated/Early/', Priority: -1 }, { Regex: '^"revng/', Priority: -2 }, { Regex: '^"clang/', Priority: -3 }, { Regex: '^"mlir/', Priority: -4 }, diff --git a/tests/unit/TupleTreeGenerator/TestClass.h b/tests/unit/TupleTreeGenerator/TestClass.h index 0e45985f4..929370139 100644 --- a/tests/unit/TupleTreeGenerator/TestClass.h +++ b/tests/unit/TupleTreeGenerator/TestClass.h @@ -11,29 +11,6 @@ #include "Generated/Early/TestClass.h" -/* TUPLE-TREE-YAML -name: TestClass -type: struct -fields: - - name: RequiredField - type: uint64_t - - name: OptionalField - type: uint64_t - optional: true - - name: EnumField - type: TestEnum - - name: SequenceField - sequence: - type: SortedVector - elementType: uint64_t - - name: ReferenceField - reference: - pointeeType: uint64_t - rootType: TestClass -key: - - RequiredField -TUPLE-TREE-YAML */ - namespace ttgtest { class TestClass : public ttgtest::generated::TestClass { public: diff --git a/tests/unit/TupleTreeGenerator/TestEnum.h b/tests/unit/TupleTreeGenerator/TestEnum.h index fd7067908..e8e89e7e6 100644 --- a/tests/unit/TupleTreeGenerator/TestEnum.h +++ b/tests/unit/TupleTreeGenerator/TestEnum.h @@ -4,13 +4,5 @@ // This file is distributed under the MIT License. See LICENSE.md for details. // -/* TUPLE-TREE-YAML -name: TestEnum -type: enum -members: - - name: MemberOne - - name: MemberTwo -TUPLE-TREE-YAML */ - #include "Generated/Early/TestEnum.h" #include "Generated/Late/TestEnum.h"