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

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


Author: Valentin Clement (バレンタイン クレメン)
Date: 2024-11-14T10:32:09-08:00
New Revision: 02018cf7931de1a09184d3313bceaba9e21d5c48

URL: https://github.com/llvm/llvm-project/commit/02018cf7931de1a09184d3313bceaba9e21d5c48
DIFF: https://github.com/llvm/llvm-project/commit/02018cf7931de1a09184d3313bceaba9e21d5c48.diff

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

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

Added: 
    

Modified: 
    flang/lib/Optimizer/Transforms/CUFOpConversion.cpp

Removed: 
    


################################################################################
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;
 }


        


More information about the flang-commits mailing list