summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/StripDebugInfo.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-02-27 10:59:29 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:47:14 -0700
commitc6c534493d625c10ce0046baa9dc6293f8dba405 (patch)
tree87246fb531049bf478bb4b061217d11b8d7fe254 /mlir/lib/Transforms/StripDebugInfo.cpp
parent6067cdebaa391cb2ab9bda9cd91b26f9ddd95a11 (diff)
downloadbcm5719-llvm-c6c534493d625c10ce0046baa9dc6293f8dba405.tar.gz
bcm5719-llvm-c6c534493d625c10ce0046baa9dc6293f8dba405.zip
Port all of the existing passes over to the new pass manager infrastructure. This is largely NFC.
PiperOrigin-RevId: 235952357
Diffstat (limited to 'mlir/lib/Transforms/StripDebugInfo.cpp')
-rw-r--r--mlir/lib/Transforms/StripDebugInfo.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/mlir/lib/Transforms/StripDebugInfo.cpp b/mlir/lib/Transforms/StripDebugInfo.cpp
index fc2b0eb0a95..0f1ba02174b 100644
--- a/mlir/lib/Transforms/StripDebugInfo.cpp
+++ b/mlir/lib/Transforms/StripDebugInfo.cpp
@@ -23,26 +23,25 @@
using namespace mlir;
namespace {
-struct StripDebugInfo : public FunctionPass {
- StripDebugInfo() : FunctionPass(&StripDebugInfo::passID) {}
-
- PassResult runOnFunction(Function *f) override;
-
- constexpr static PassID passID = {};
+struct StripDebugInfo : public FunctionPass<StripDebugInfo> {
+ PassResult runOnFunction() override;
};
} // end anonymous namespace
-PassResult StripDebugInfo::runOnFunction(Function *f) {
- UnknownLoc unknownLoc = UnknownLoc::get(f->getContext());
+PassResult StripDebugInfo::runOnFunction() {
+ Function &func = getFunction();
+ UnknownLoc unknownLoc = UnknownLoc::get(func.getContext());
// Strip the debug info from the function and its instructions.
- f->setLoc(unknownLoc);
- f->walk([&](Instruction *inst) { inst->setLoc(unknownLoc); });
+ func.setLoc(unknownLoc);
+ func.walk([&](Instruction *inst) { inst->setLoc(unknownLoc); });
return success();
}
/// Creates a pass to strip debug information from a function.
-FunctionPass *mlir::createStripDebugInfoPass() { return new StripDebugInfo(); }
+FunctionPassBase *mlir::createStripDebugInfoPass() {
+ return new StripDebugInfo();
+}
static PassRegistration<StripDebugInfo>
pass("strip-debuginfo", "Strip debug info from functions and instructions");
OpenPOWER on IntegriCloud