[flang] Fix some memory leaks (#121050)
This commit fixes some but not all memory leaks in Flang. There are still 91 tests that fail with ASAN. - Use `mlir::OwningOpRef` instead of `std::unique_ptr`. The latter does not free allocations of nested blocks. - Pass `ModuleOp` as value instead of reference. - Add few missing deallocations in test cases and other places.
This commit is contained in:
committed by
GitHub
parent
c29536b033
commit
c870632ef6
@@ -3087,7 +3087,7 @@ struct GlobalOpConversion : public fir::FIROpConversion<fir::GlobalOp> {
|
||||
private:
|
||||
static void addComdat(mlir::LLVM::GlobalOp &global,
|
||||
mlir::ConversionPatternRewriter &rewriter,
|
||||
mlir::ModuleOp &module) {
|
||||
mlir::ModuleOp module) {
|
||||
const char *comdatName = "__llvm_comdat";
|
||||
mlir::LLVM::ComdatOp comdatOp =
|
||||
module.lookupSymbol<mlir::LLVM::ComdatOp>(comdatName);
|
||||
|
||||
Reference in New Issue
Block a user