Files
revng-revng/collectfunctionboundaries.h
T
Alessandro Di Federico e577f74bfa Introduce revamb-dump
`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.
2016-12-04 00:26:10 +01:00

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