mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
2b9cbb98ec
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.
29 lines
636 B
C++
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();
|
|
}
|
|
};
|