Files
revng-revng/include/revng/EarlyFunctionAnalysis/FunctionEdge.h
Alessandro Di Federico 247879f7fc model::Type::ID: switch to progressive IDs
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.

On top of this, this commit introduces the following changes:

* TypeCopier: import all the necessary PrimitiveTypes and improve
  handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
  an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
  of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
  `Binary.recordNewType(makeType<model::*Type>())`.
2023-08-23 16:14:04 +02:00

48 lines
1.3 KiB
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "revng/EarlyFunctionAnalysis/FunctionEdgeBase.h"
#include "revng/Model/VerifyHelper.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"
class efa::FunctionEdge : public efa::generated::FunctionEdge {
private:
static constexpr const FunctionEdgeType::Values
AssociatedType = FunctionEdgeType::DirectBranch;
public:
using generated::FunctionEdge::FunctionEdge;
FunctionEdge() : efa::generated::FunctionEdge() { Type() = AssociatedType; }
FunctionEdge(BasicBlockID Destination, FunctionEdgeType::Values Type) :
efa::generated::FunctionEdge() {
this->Destination() = Destination;
this->Type() = Type;
}
public:
static bool classof(const FunctionEdgeBase *A) { return classof(A->key()); }
static bool classof(const Key &K) {
return std::get<1>(K) == FunctionEdgeBaseKind::FunctionEdge;
}
bool verify() const debug_function;
bool verify(bool Assert) const debug_function;
bool verify(model::VerifyHelper &VH) const;
void dump() const debug_function;
};
#include "revng/EarlyFunctionAnalysis/Generated/Late/FunctionEdge.h"