[flang-commits] [flang] 0f82940 - [NFC][flang] Add the header file Todo.h. This file is being upstreamed to satisfy dependencies and enable continued progress on lowering of OpenMP, OpenACC, etc.
Eric Schweitz via flang-commits
flang-commits at lists.llvm.org
Tue Oct 6 11:32:08 PDT 2020
Author: Eric Schweitz
Date: 2020-10-06T11:31:46-07:00
New Revision: 0f8294072fbc75cc4f6d0e1c3e16f9849aae3771
URL: https://github.com/llvm/llvm-project/commit/0f8294072fbc75cc4f6d0e1c3e16f9849aae3771
DIFF: https://github.com/llvm/llvm-project/commit/0f8294072fbc75cc4f6d0e1c3e16f9849aae3771.diff
LOG: [NFC][flang] Add the header file Todo.h. This file is being upstreamed to satisfy dependencies and enable continued progress on lowering of OpenMP, OpenACC, etc.
Differential Revision: https://reviews.llvm.org/D88909
Added:
flang/include/flang/Lower/Todo.h
Modified:
Removed:
################################################################################
diff --git a/flang/include/flang/Lower/Todo.h b/flang/include/flang/Lower/Todo.h
new file mode 100644
index 000000000000..4da24f305d94
--- /dev/null
+++ b/flang/include/flang/Lower/Todo.h
@@ -0,0 +1,49 @@
+//===-- Lower/Todo.h --------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_LOWER_TODO_H
+#define FORTRAN_LOWER_TODO_H
+
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
+#include <cstdlib>
+
+// This is throw-away code used to mark areas of the code that have not yet been
+// developed.
+
+#undef TODO
+
+#ifdef NDEBUG
+
+// In a release build, just give a message and exit.
+#define TODO(ToDoMsg) \
+ do { \
+ llvm::errs() << __FILE__ << ':' << __LINE__ << ": not yet implemented " \
+ << ToDoMsg << '\n'; \
+ std::exit(1); \
+ } while (false)
+
+#else
+
+#undef TODOQUOTE
+#define TODOQUOTE(X) #X
+
+// In a developer build, print a message and give a backtrace.
+#define TODO(ToDoMsg) \
+ do { \
+ llvm::report_fatal_error( \
+ __FILE__ ":" TODOQUOTE(__LINE__) ": not yet implemented " ToDoMsg); \
+ } while (false)
+
+#endif
+
+#endif // FORTRAN_LOWER_TODO_H
More information about the flang-commits
mailing list