mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
e577f74bfa
`revamb-dump` is a tool to extract various information from the LLVM IR generated by `revamb` and output them in a more human-friendly format, typically CSV. The main source of information are the various metadata. Currently `revamb-dump` can collect the CFG, function boundaries and `noreturn` functions.
41 lines
816 B
C++
41 lines
816 B
C++
#ifndef _COLLECTFUNCTIONBOUNDARIES_H
|
|
#define _COLLECTFUNCTIONBOUNDARIES_H
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
// Standard includes
|
|
#include <fstream>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
// LLVM includes
|
|
#include "llvm/Pass.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
namespace llvm {
|
|
class BasicBlock;
|
|
}
|
|
|
|
class CollectFunctionBoundaries : public llvm::FunctionPass {
|
|
public:
|
|
static char ID;
|
|
|
|
public:
|
|
CollectFunctionBoundaries() : llvm::FunctionPass(ID) { }
|
|
|
|
bool runOnFunction(llvm::Function &F) override;
|
|
|
|
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
|
|
AU.setPreservesAll();
|
|
}
|
|
|
|
void serialize(std::ostream &Output);
|
|
|
|
private:
|
|
std::map<llvm::StringRef, std::vector<llvm::BasicBlock *>> Functions;
|
|
};
|
|
|
|
#endif // _COLLECTFUNCTIONBOUNDARIES_H
|