[flang] Remove unused code and redundant assertion.

Differential Revision: https://reviews.llvm.org/D121864
This commit is contained in:
Eric Schweitz 2022-03-16 15:23:25 -07:00
parent fa331da8fb
commit fb99266401
2 changed files with 6 additions and 8 deletions

View File

@ -64,10 +64,10 @@ public:
//===--------------------------------------------------------------------===//
mlir::MLIRContext &getMLIRContext() { return context; }
mlir::ModuleOp &getModule() {
assert(module && "This bridge is missing an MLIR module");
return *module.get();
}
/// Get the ModuleOp. It can never be null, which is asserted in the ctor.
mlir::ModuleOp &getModule() { return *module.get(); }
const Fortran::common::IntrinsicTypeDefaultKinds &getDefaultKinds() const {
return defaultKinds;
}
@ -84,8 +84,6 @@ public:
/// Create a folding context. Careful: this is very expensive.
Fortran::evaluate::FoldingContext createFoldingContext() const;
bool validModule() { return (module != nullptr); }
//===--------------------------------------------------------------------===//
// Perform the creation of an mlir::ModuleOp
//===--------------------------------------------------------------------===//

View File

@ -2454,6 +2454,6 @@ Fortran::lower::LoweringBridge::LoweringBridge(
module = std::make_unique<mlir::ModuleOp>(
mlir::ModuleOp::create(mlir::UnknownLoc::get(&context)));
assert(module.get() && "module was not created");
fir::setTargetTriple(*module.get(), triple);
fir::setKindMapping(*module.get(), kindMap);
fir::setTargetTriple(getModule(), triple);
fir::setKindMapping(getModule(), kindMap);
}