mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
739bed3c1d
This is done mainly so that downstream passes do not need to run `CollectCFG` to store information that has already been computed but not serialized. This come at the cost of computing the CFG also of functions we don't want to analyze in `DetectABI`.
62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/EarlyFunctionAnalysis/BasicBlock.h"
|
|
#include "revng/Model/VerifyHelper.h"
|
|
#include "revng/Support/MetaAddress.h"
|
|
#include "revng/Support/MetaAddress/YAMLTraits.h"
|
|
#include "revng/Support/YAMLTraits.h"
|
|
#include "revng/TupleTree/TupleTree.h"
|
|
|
|
namespace llvm {
|
|
class BasicBlock;
|
|
}
|
|
class GeneratedCodeBasicInfo;
|
|
|
|
/* TUPLE-TREE-YAML
|
|
name: FunctionMetadata
|
|
doc: "Metadata attached to a function. As of now, it includes a list of basic
|
|
blocks, representing the control-flow graph. It is meant to include further
|
|
information in the future."
|
|
type: struct
|
|
fields:
|
|
- name: Entry
|
|
doc: Start address of the basic block
|
|
type: MetaAddress
|
|
- name: ControlFlowGraph
|
|
sequence:
|
|
type: SortedVector
|
|
elementType: BasicBlock
|
|
optional: true
|
|
key:
|
|
- Entry
|
|
TUPLE-TREE-YAML */
|
|
|
|
#include "revng/EarlyFunctionAnalysis/Generated/Early/FunctionMetadata.h"
|
|
|
|
class efa::FunctionMetadata : public efa::generated::FunctionMetadata {
|
|
public:
|
|
using generated::FunctionMetadata::FunctionMetadata;
|
|
|
|
public:
|
|
const efa::BasicBlock *
|
|
findBlock(GeneratedCodeBasicInfo &GCBI, llvm::BasicBlock *BB) const;
|
|
|
|
void serialize(GeneratedCodeBasicInfo &GCBI) const;
|
|
|
|
public:
|
|
bool verify(const model::Binary &Binary) const debug_function;
|
|
bool verify(const model::Binary &Binary, bool Assert) const debug_function;
|
|
bool verify(const model::Binary &Binary, model::VerifyHelper &VH) const;
|
|
void dump() const debug_function;
|
|
void dumpCFG(const model::Binary &Binary) const debug_function;
|
|
|
|
public:
|
|
void simplify(const model::Binary &Binary);
|
|
};
|
|
|
|
#include "revng/EarlyFunctionAnalysis/Generated/Late/FunctionMetadata.h"
|