Files
revng-revng/include/revng/FunctionIsolation/InvokeIsolatedFunctions.h
Alessandro Di Federico 2b9cbb98ec Introduce --invoke-isolated-functions
This commit ensures that FunctionIsolation and EnforceABI do only
thing. This means that they no longer modify `root`.

Instead, we have a new pass, `invoke-isolated-functions` that needs to
be run after them and replaces the entry point of the functions with
invokes to the isolated functions, possibly with the appropriate
arguments.
2021-04-22 14:45:52 +02:00

29 lines
636 B
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include <memory>
#include "llvm/Pass.h"
#include "revng/BasicAnalyses/GeneratedCodeBasicInfo.h"
#include "revng/Model/LoadModelPass.h"
class InvokeIsolatedFunctionsPass : public llvm::ModulePass {
public:
static char ID;
public:
InvokeIsolatedFunctionsPass() : ModulePass(ID) {}
bool runOnModule(llvm::Module &M) override;
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override {
AU.addRequired<GeneratedCodeBasicInfoWrapperPass>();
AU.addRequired<LoadModelWrapperPass>();
AU.setPreservesAll();
}
};