[llvm] eec670a - Revert "[Lint] Use new PM instead of legacy PM in lintFunction and lintModule"
Bjorn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 10:30:34 PST 2023
Author: Bjorn Pettersson
Date: 2023-02-06T19:29:06+01:00
New Revision: eec670ac8ebe1e8fe593649fa553a33825771183
URL: https://github.com/llvm/llvm-project/commit/eec670ac8ebe1e8fe593649fa553a33825771183
DIFF: https://github.com/llvm/llvm-project/commit/eec670ac8ebe1e8fe593649fa553a33825771183.diff
LOG: Revert "[Lint] Use new PM instead of legacy PM in lintFunction and lintModule"
This reverts commit 525ed98be483188db6dc3bb69cecd0123148ceca.
Some buildbots are failing when linking bugpoint.
Reverting to investigate that further.
Added:
Modified:
llvm/lib/Analysis/Lint.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp
index cb281256373f..d3120a41ac27 100644
--- a/llvm/lib/Analysis/Lint.cpp
+++ b/llvm/lib/Analysis/Lint.cpp
@@ -60,13 +60,13 @@
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
-#include "llvm/Passes/PassBuilder.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/raw_ostream.h"
@@ -771,33 +771,17 @@ void llvm::lintFunction(const Function &f) {
Function &F = const_cast<Function &>(f);
assert(!F.isDeclaration() && "Cannot lint external functions");
- PassBuilder PB;
- LoopAnalysisManager LAM;
- FunctionAnalysisManager FAM;
- CGSCCAnalysisManager CGAM;
- ModuleAnalysisManager MAM;
- PB.registerModuleAnalyses(MAM);
- PB.registerFunctionAnalyses(FAM);
- PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
-
- FunctionPassManager FPM;
- FPM.addPass(LintPass());
- FPM.run(F, FAM);
+ legacy::FunctionPassManager FPM(F.getParent());
+ auto *V = new LintLegacyPass();
+ FPM.add(V);
+ FPM.run(F);
}
/// lintModule - Check a module for errors, printing messages on stderr.
///
void llvm::lintModule(const Module &M) {
- PassBuilder PB;
- LoopAnalysisManager LAM;
- FunctionAnalysisManager FAM;
- CGSCCAnalysisManager CGAM;
- ModuleAnalysisManager MAM;
- PB.registerModuleAnalyses(MAM);
- PB.registerFunctionAnalyses(FAM);
- PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
-
- ModulePassManager MPM;
- MPM.addPass(createModuleToFunctionPassAdaptor(LintPass()));
- MPM.run(const_cast<Module &>(M), MAM);
+ legacy::PassManager PM;
+ auto *V = new LintLegacyPass();
+ PM.add(V);
+ PM.run(const_cast<Module &>(M));
}
More information about the llvm-commits
mailing list