Files
revng-revng/stackanalysis.h
T
Alessandro Di Federico a5af28621b Introducing the stack analysis
The stack analysis is the foundation to obtain accurate information
about the body of a function, which registers are callee-saved,
arguments, return values and so on.

It is implemented as a pass to run in revamb-dump.

This commit also introduces analysis tests specific to what we aim to
obtain from the analysis and also some basic unit tests for data
structures related to the stack analysis.
2017-08-12 16:56:23 +02:00

50 lines
854 B
C++

#ifndef _STACKANALYSIS_H
#define _STACKANALYSIS_H
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
// Standard includes
// LLVM includes
#include "llvm/Pass.h"
// Local includes
#include "generatedcodebasicinfo.h"
// Forward declarations
namespace llvm {
class BasicBlock;
}
class JumpTargetManager;
namespace StackAnalysis {
class StackAnalysis : public llvm::FunctionPass {
public:
static char ID;
public:
StackAnalysis() : llvm::FunctionPass(ID) { }
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
AU.setPreservesAll();
AU.addRequired<GeneratedCodeBasicInfo>();
}
bool runOnFunction(llvm::Function &F) override;
void serialize(std::ostream &Output) {
Output << TextRepresentation;
}
private:
std::string TextRepresentation;
};
}
#endif // _STACKANALYSIS_H