mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
Move the closure of the subset of flang/runtime/*.h header files that are referenced by source files outside flang/runtime (apart from unit tests) into a new directory (flang/include/flang/Runtime) so that relative include paths into ../runtime need not be used. flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate; it's not used by the runtime. Differential Revision: https://reviews.llvm.org/D109107
22 lines
730 B
C++
22 lines
730 B
C++
//===-- runtime/command.cpp -----------------------------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "flang/Runtime/command.h"
|
|
#include "environment.h"
|
|
|
|
namespace Fortran::runtime {
|
|
CppTypeFor<TypeCategory::Integer, 4> RTNAME(ArgumentCount)() {
|
|
int argc{executionEnvironment.argc};
|
|
if (argc > 1) {
|
|
// C counts the command name as one of the arguments, but Fortran doesn't.
|
|
return argc - 1;
|
|
}
|
|
return 0;
|
|
}
|
|
} // namespace Fortran::runtime
|