mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
2e241acae3
This commit drops the old FunctionBoundariesDetectionPass and introduces a new one based on the results provided by the StackAnalysis. A very similar pass, the ABIDetectionPass, is now available to offer the results of the ABI analysis too. These two new passes are a thin shim depending on the appropriate version of the StackAnalysis (with or withour ABI anlysis) and simply call `serializeMetadata`, which decorates the LLVM IR with the requested information. In addition to drop the old analysis, this commit also isolates the function boundaries detection pass from `revamb` making it available as a library only.
36 lines
802 B
C++
36 lines
802 B
C++
#ifndef FUNCTIONBOUNDARIESDETECTIONPASS_H
|
|
#define FUNCTIONBOUNDARIESDETECTIONPASS_H
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
// LLVM includes
|
|
#include "llvm/Pass.h"
|
|
|
|
// Local libraries includes
|
|
#include "revng/StackAnalysis/StackAnalysis.h"
|
|
|
|
namespace StackAnalysis {
|
|
|
|
class FunctionBoundariesDetectionPass : public llvm::ModulePass {
|
|
public:
|
|
static char ID;
|
|
|
|
public:
|
|
FunctionBoundariesDetectionPass() : llvm::ModulePass(ID) {}
|
|
|
|
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
|
|
AU.setPreservesAll();
|
|
AU.addRequired<StackAnalysis<false>>();
|
|
}
|
|
|
|
void serialize(std::ostream &Output, llvm::Module &M);
|
|
|
|
bool runOnModule(llvm::Module &M) override;
|
|
};
|
|
|
|
} // namespace StackAnalysis
|
|
|
|
#endif // FUNCTIONBOUNDARIESDETECTIONPASS_H
|