[flang] Add runtime interface for COMMAND_ARGUMENT_COUNT
authorDiana Picus <diana.picus@linaro.org>
Wed, 25 Aug 2021 03:16:30 +0000 (03:16 +0000)
committerDiana Picus <diana.picus@linaro.org>
Mon, 30 Aug 2021 07:31:13 +0000 (07:31 +0000)
Differential Revision: https://reviews.llvm.org/D108687

flang/runtime/command.h [new file with mode: 0644]

diff --git a/flang/runtime/command.h b/flang/runtime/command.h
new file mode 100644 (file)
index 0000000..a2e23fc
--- /dev/null
@@ -0,0 +1,25 @@
+//===-- runtime/command.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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_RUNTIME_COMMAND_H_
+#define FORTRAN_RUNTIME_COMMAND_H_
+
+#include "cpp-type.h"
+#include "entry-names.h"
+
+namespace Fortran::runtime {
+extern "C" {
+// 16.9.51 COMMAND_ARGUMENT_COUNT
+//
+// Lowering may need to cast the result to match the precision of the default
+// integer kind.
+CppTypeFor<TypeCategory::Integer, 4> RTNAME(ArgumentCount)();
+}
+} // namespace Fortran::runtime
+
+#endif // FORTRAN_RUNTIME_COMMAND_H_