[AArch64,ELF] Restrict MOVZ/MOVK to non-PIC large code model (#70178)
[llvm-project.git] / flang / runtime / environment.h
blob82a5ec8f4ebfb0681cedcd5a444af0326673eee6
1 //===-- runtime/environment.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef FORTRAN_RUNTIME_ENVIRONMENT_H_
10 #define FORTRAN_RUNTIME_ENVIRONMENT_H_
12 #include "flang/Decimal/decimal.h"
13 #include <optional>
15 struct EnvironmentDefaultList;
17 namespace Fortran::runtime {
19 class Terminator;
21 #if FLANG_BIG_ENDIAN
22 constexpr bool isHostLittleEndian{false};
23 #elif FLANG_LITTLE_ENDIAN
24 constexpr bool isHostLittleEndian{true};
25 #else
26 #error host endianness is not known
27 #endif
29 // External unformatted I/O data conversions
30 enum class Convert { Unknown, Native, LittleEndian, BigEndian, Swap };
32 std::optional<Convert> GetConvertFromString(const char *, std::size_t);
34 struct ExecutionEnvironment {
35 constexpr ExecutionEnvironment(){};
36 void Configure(int argc, const char *argv[], const char *envp[],
37 const EnvironmentDefaultList *envDefaults);
38 const char *GetEnv(
39 const char *name, std::size_t name_length, const Terminator &terminator);
41 int argc{0};
42 const char **argv{nullptr};
43 char **envp{nullptr};
45 int listDirectedOutputLineLengthLimit{79}; // FORT_FMT_RECL
46 enum decimal::FortranRounding defaultOutputRoundingMode{
47 decimal::FortranRounding::RoundNearest}; // RP(==PN)
48 Convert conversion{Convert::Unknown}; // FORT_CONVERT
49 bool noStopMessage{false}; // NO_STOP_MESSAGE=1 inhibits "Fortran STOP"
50 bool defaultUTF8{false}; // DEFAULT_UTF8
53 extern ExecutionEnvironment executionEnvironment;
54 } // namespace Fortran::runtime
56 #endif // FORTRAN_RUNTIME_ENVIRONMENT_H_