mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
247879f7fc
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>())`.
61 lines
1.7 KiB
C++
61 lines
1.7 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/EarlyFunctionAnalysis/FunctionEdgeType.h"
|
|
#include "revng/Model/VerifyHelper.h"
|
|
#include "revng/Support/BasicBlockID/YAMLTraits.h"
|
|
#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
|
|
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"
|
|
|
|
class efa::FunctionEdgeBase : public efa::generated::FunctionEdgeBase {
|
|
public:
|
|
using generated::FunctionEdgeBase::FunctionEdgeBase;
|
|
|
|
public:
|
|
static bool classof(const FunctionEdgeBase *A) { return classof(A->key()); }
|
|
static bool classof(const Key &K) { return true; }
|
|
|
|
public:
|
|
bool isDirect() const { return Destination().isValid(); }
|
|
bool isIndirect() const { return not isDirect(); }
|
|
|
|
public:
|
|
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/FunctionEdgeBase.h"
|