[flang-commits] [flang] [flang][cuda][NFC] Use mlir::emitError to get location (PR #116267)

via flang-commits flang-commits at lists.llvm.org
Thu Nov 14 10:28:16 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Valentin Clement (バレンタイン クレメン) (clementval)

<details>
<summary>Changes</summary>

Use `mlir::emitError` so we can get location information on error. 

---
Full diff: https://github.com/llvm/llvm-project/pull/116267.diff


1 Files Affected:

- (modified) flang/lib/Optimizer/Transforms/CUFOpConversion.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp b/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
index 58a348314573d5..0fa30cb28d84a6 100644
--- a/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
@@ -283,7 +283,7 @@ static int computeWidth(mlir::Location loc, mlir::Type type,
         mlir::cast<mlir::FloatType>(t.getElementType()).getWidth() / 8;
     width = 2 * elemSize;
   } else {
-    llvm::report_fatal_error("unsupported type");
+    mlir::emitError(loc, "unsupported type");
   }
   return width;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/116267


More information about the flang-commits mailing list