[flang-commits] [flang] 836e34f - [flang][NFC] Use TODO with location

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Mon Mar 14 03:50:12 PDT 2022


Author: Valentin Clement
Date: 2022-03-14T11:50:06+01:00
New Revision: 836e34f727e17baa6507a5c6cc19d41dce8e769d

URL: https://github.com/llvm/llvm-project/commit/836e34f727e17baa6507a5c6cc19d41dce8e769d
DIFF: https://github.com/llvm/llvm-project/commit/836e34f727e17baa6507a5c6cc19d41dce8e769d.diff

LOG: [flang][NFC] Use TODO with location

Use the TODO macro in `flang/Lower/Todo.h` with the converter location.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D121582

Added: 
    

Modified: 
    flang/lib/Lower/Coarray.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/Coarray.cpp b/flang/lib/Lower/Coarray.cpp
index f59614b39503f..97a420ad78751 100644
--- a/flang/lib/Lower/Coarray.cpp
+++ b/flang/lib/Lower/Coarray.cpp
@@ -14,18 +14,11 @@
 #include "flang/Lower/Coarray.h"
 #include "flang/Lower/AbstractConverter.h"
 #include "flang/Lower/SymbolMap.h"
+#include "flang/Lower/Todo.h"
 #include "flang/Optimizer/Builder/FIRBuilder.h"
 #include "flang/Parser/parse-tree.h"
 #include "flang/Semantics/expression.h"
 
-#undef TODO
-#define TODO(MSG)                                                              \
-  {                                                                            \
-    mlir::emitError(converter.getCurrentLocation(), "not yet implemented")     \
-        << MSG;                                                                \
-    exit(1);                                                                   \
-  }
-
 //===----------------------------------------------------------------------===//
 // TEAM statements and constructs
 //===----------------------------------------------------------------------===//
@@ -34,27 +27,27 @@ void Fortran::lower::genChangeTeamConstruct(
     Fortran::lower::AbstractConverter &converter,
     Fortran::lower::pft::Evaluation &,
     const Fortran::parser::ChangeTeamConstruct &) {
-  TODO("CHANGE TEAM construct");
+  TODO(converter.getCurrentLocation(), "CHANGE TEAM construct");
 }
 
 void Fortran::lower::genChangeTeamStmt(
     Fortran::lower::AbstractConverter &converter,
     Fortran::lower::pft::Evaluation &,
     const Fortran::parser::ChangeTeamStmt &) {
-  TODO("CHANGE TEAM stmt");
+  TODO(converter.getCurrentLocation(), "CHANGE TEAM stmt");
 }
 
 void Fortran::lower::genEndChangeTeamStmt(
     Fortran::lower::AbstractConverter &converter,
     Fortran::lower::pft::Evaluation &,
     const Fortran::parser::EndChangeTeamStmt &) {
-  TODO("END CHANGE TEAM");
+  TODO(converter.getCurrentLocation(), "END CHANGE TEAM");
 }
 
 void Fortran::lower::genFormTeamStatement(
     Fortran::lower::AbstractConverter &converter,
     Fortran::lower::pft::Evaluation &, const Fortran::parser::FormTeamStmt &) {
-  TODO("FORM TEAM");
+  TODO(converter.getCurrentLocation(), "FORM TEAM");
 }
 
 //===----------------------------------------------------------------------===//
@@ -64,10 +57,10 @@ void Fortran::lower::genFormTeamStatement(
 fir::ExtendedValue Fortran::lower::CoarrayExprHelper::genAddr(
     const Fortran::evaluate::CoarrayRef &expr) {
   (void)symMap;
-  TODO("co-array address");
+  TODO(converter.getCurrentLocation(), "co-array address");
 }
 
 fir::ExtendedValue Fortran::lower::CoarrayExprHelper::genValue(
     const Fortran::evaluate::CoarrayRef &expr) {
-  TODO("co-array value");
+  TODO(converter.getCurrentLocation(), "co-array value");
 }


        


More information about the flang-commits mailing list