Straightforward port of StatepointIRVerifier pass to new Pass Manager framework.
Fix By: skatkov
Reviewed By: fedor.sergeev
Differential Revision: https://reviews.llvm.org/D59825
This is a re-land of r357147/r357148 with LLVM_ENABLE_MODULES build fixed.
Adding IR/SafepointIRVerifier.h into its own module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357361
91177308-0d34-0410-b5e6-
96231b3b80d8
#ifndef LLVM_IR_SAFEPOINT_IR_VERIFIER
#define LLVM_IR_SAFEPOINT_IR_VERIFIER
+#include "llvm/IR/PassManager.h"
+
namespace llvm {
class Function;
/// Create an instance of the safepoint verifier pass which can be added to
/// a pass pipeline to check for relocation bugs.
FunctionPass *createSafepointIRVerifierPass();
+
+/// Create an instance of the safepoint verifier pass which can be added to
+/// a pass pipeline to check for relocation bugs.
+class SafepointIRVerifierPass : public PassInfoMixin<SafepointIRVerifierPass> {
+
+public:
+ explicit SafepointIRVerifierPass() {}
+
+ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+};
}
#endif // LLVM_IR_SAFEPOINT_IR_VERIFIER
}
module IR_IntrinsicInst { header "IR/IntrinsicInst.h" export * }
module IR_PatternMatch { header "IR/PatternMatch.h" export * }
+ module IR_SafepointIRVerifier { header "IR/SafepointIRVerifier.h" export * }
module IR_Statepoint { header "IR/Statepoint.h" export * }
export *
static void Verify(const Function &F, const DominatorTree &DT,
const CFGDeadness &CD);
+namespace llvm {
+PreservedAnalyses SafepointIRVerifierPass::run(Function &F,
+ FunctionAnalysisManager &AM) {
+ const auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
+ CFGDeadness CD;
+ CD.processFunction(F, DT);
+ Verify(F, DT, CD);
+ return PreservedAnalyses::all();
+}
+}
+
namespace {
struct SafepointIRVerifier : public FunctionPass {
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/PassManager.h"
+#include "llvm/IR/SafepointIRVerifier.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
FUNCTION_PASS("verify<loops>", LoopVerifierPass())
FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
+FUNCTION_PASS("verify<safepoint-ir>", SafepointIRVerifierPass())
FUNCTION_PASS("view-cfg", CFGViewerPass())
FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass())
FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())