Files
revng-revng/lib/StackAnalysis/ABIDetectionPass.cpp
T
Alessandro Di Federico 2e241acae3 Introduce SA-based ABIDetection and FBD passes
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.
2019-01-18 15:18:47 +01:00

27 lines
600 B
C++

/// \file ABIDetectionPass.cpp
/// \brief
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
// Local libraries includes
#include "revng/StackAnalysis/ABIDetectionPass.h"
using namespace llvm;
namespace StackAnalysis {
char ABIDetectionPass::ID = 0;
using Register = RegisterPass<ABIDetectionPass>;
static Register X("detect-abi", "ABI Detection Pass", true, true);
bool ABIDetectionPass::runOnModule(Module &M) {
auto &SA = getAnalysis<StackAnalysis<true>>();
SA.serializeMetadata(*M.getFunction("root"));
return false;
}
} // namespace StackAnalysis