FLANG
LangOptions.h
1//===------ LangOptions.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//===----------------------------------------------------------------------===//
8//
9// This file defines the LangOptions interface, which holds the
10// configuration for LLVM's middle-end and back-end. It controls LLVM's code
11// generation into assembly or machine code.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef FORTRAN_COMMON_LANGOPTIONS_H
16#define FORTRAN_COMMON_LANGOPTIONS_H
17
18#include <string>
19#include <vector>
20
21#include "llvm/TargetParser/Triple.h"
22
23namespace Fortran::common {
24
28
29public:
30 enum SignedOverflowBehaviorTy {
31 // -fno-wrapv (default behavior in Flang)
32 SOB_Undefined,
33
34 // -fwrapv
35 SOB_Defined,
36 };
37
38 enum FPModeKind {
39 // Do not fuse FP ops
40 FPM_Off,
41
42 // Aggressively fuse FP ops (E.g. FMA).
43 FPM_Fast,
44 };
45
46#define LANGOPT(Name, Bits, Default) unsigned Name : Bits;
47#define ENUM_LANGOPT(Name, Type, Bits, Default)
48#include "flang/Common/LangOptions.def"
49
50protected:
51#define LANGOPT(Name, Bits, Default)
52#define ENUM_LANGOPT(Name, Type, Bits, Default) unsigned Name : Bits;
53#include "flang/Common/LangOptions.def"
54};
55
59
60public:
61 // Define accessors/mutators for code generation options of enumeration type.
62#define LANGOPT(Name, Bits, Default)
63#define ENUM_LANGOPT(Name, Type, Bits, Default) \
64 Type get##Name() const { return static_cast<Type>(Name); } \
65 void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
66#include "flang/Common/LangOptions.def"
67
70 std::string OMPHostIRFile;
71
73 std::vector<llvm::Triple> OMPTargetTriples;
74
76};
77
78} // end namespace Fortran::common
79
80#endif // FORTRAN_COMMON_LANGOPTIONS_H
Definition: LangOptions.h:27
Definition: LangOptions.h:58
std::vector< llvm::Triple > OMPTargetTriples
List of triples passed in using -fopenmp-targets.
Definition: LangOptions.h:73
std::string OMPHostIRFile
Definition: LangOptions.h:70
Definition: bit-population-count.h:20