15#ifndef FORTRAN_FRONTEND_CODEGENOPTIONS_H
16#define FORTRAN_FRONTEND_CODEGENOPTIONS_H
18#include "flang/Optimizer/OpenMP/Utils.h"
20#include "llvm/Frontend/Debug/Options.h"
21#include "llvm/Frontend/Driver/CodeGenOptions.h"
22#include "llvm/Support/CodeGen.h"
23#include "llvm/Support/Regex.h"
24#include "llvm/Target/TargetOptions.h"
25#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
32namespace Fortran::frontend {
39#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
40#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
41#include "flang/Frontend/CodeGenOptions.def"
44#define CODEGENOPT(Name, Bits, Default)
45#define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
46#include "flang/Frontend/CodeGenOptions.def"
99 enum class RemarkKind {
110 llvm::CodeObjectVersionKind::COV_None;
114 RemarkKind Kind = RemarkKind::RK_Missing;
116 std::shared_ptr<llvm::Regex> Regex;
186 return getProfileInstr() == llvm::driver::ProfileClangInstr;
191 return getProfileInstr() == llvm::driver::ProfileIRInstr;
196 return getProfileInstr() == llvm::driver::ProfileCSIRInstr;
200 return getProfileUse() == llvm::driver::ProfileIRInstr ||
201 getProfileUse() == llvm::driver::ProfileCSIRInstr;
205 return getProfileUse() == llvm::driver::ProfileCSIRInstr;
234#define CODEGENOPT(Name, Bits, Default)
235#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
236 Type get##Name() const { return static_cast<Type>(Name); } \
237 void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
238#include "flang/Frontend/CodeGenOptions.def"
243std::optional<llvm::CodeModel::Model> getCodeModel(llvm::StringRef
string);
Definition CodeGenOptions.h:36
Definition CodeGenOptions.h:51
std::string MemoryProfileUsePath
Name of the profile file to use as input for -fmemory-profile-use.
Definition CodeGenOptions.h:168
std::string PreferVectorWidth
The prefered vector width, if requested by -mprefer-vector-width.
Definition CodeGenOptions.h:58
std::string OptRecordPasses
Definition CodeGenOptions.h:88
std::vector< std::string > DependentLibs
Options to add to the linker for the object file.
Definition CodeGenOptions.h:94
std::string SplitDwarfFile
Definition CodeGenOptions.h:179
bool hasProfileClangInstr() const
Check if Clang profile instrumenation is on.
Definition CodeGenOptions.h:185
std::string SplitDwarfOutput
Output filename for the split debug info, not used in the skeleton CU.
Definition CodeGenOptions.h:182
OptRemark OptimizationRemark
Definition CodeGenOptions.h:137
llvm::CodeObjectVersionKind CodeObjectVersion
Code object version for AMDGPU.
Definition CodeGenOptions.h:109
OptRemark OptimizationRemarkAnalysis
Definition CodeGenOptions.h:150
std::string InstrProfileOutput
Definition CodeGenOptions.h:165
std::string ProfileRemappingFile
Definition CodeGenOptions.h:175
std::string Reciprocals
List of reciprocal estimate sub-options.
Definition CodeGenOptions.h:61
std::vector< std::string > LLVMPassPlugins
The paths to the pass plugins that were registered using -fpass-plugin.
Definition CodeGenOptions.h:55
std::string OptRecordFormat
The format used for serializing remarks (default: YAML)
Definition CodeGenOptions.h:91
std::optional< std::string > SaveTempsDir
The directory where temp files are stored if specified by -save-temps.
Definition CodeGenOptions.h:72
flangomp::DoConcurrentMappingKind DoConcurrentMappingKind
Definition CodeGenOptions.h:161
bool hasProfileCSIRInstr() const
Check if CS IR level profile instrumentation is on.
Definition CodeGenOptions.h:195
std::string CodeModel
The code model to use (-mcmodel).
Definition CodeGenOptions.h:153
std::vector< std::string > OffloadObjects
Definition CodeGenOptions.h:65
ComplexRangeKind
Controls the various implementations for complex division.
Definition CodeGenOptions.h:209
@ CX_Full
Definition CodeGenOptions.h:213
@ CX_None
No range rule is enabled.
Definition CodeGenOptions.h:227
@ CX_Basic
Definition CodeGenOptions.h:224
@ CX_Improved
Definition CodeGenOptions.h:219
std::string ProfileInstrumentUsePath
Name of the profile file to use as input for -fprofile-instr-use.
Definition CodeGenOptions.h:171
std::string DwarfDebugFlags
Definition CodeGenOptions.h:80
std::optional< std::string > RecordCommandLine
The string containing the commandline for the llvm.commandline metadata.
Definition CodeGenOptions.h:75
std::string OptRecordFile
Definition CodeGenOptions.h:84
std::vector< std::string > BuiltinBCLibs
Definition CodeGenOptions.h:69
uint64_t LargeDataThreshold
Definition CodeGenOptions.h:157
OptRemark OptimizationRemarkMissed
Definition CodeGenOptions.h:143
bool hasProfileIRInstr() const
Check if IR level profile instrumentation is on.
Definition CodeGenOptions.h:190
bool hasProfileCSIRUse() const
Check if CSIR profile use is on.
Definition CodeGenOptions.h:204
bool hasProfileIRUse() const
Check if IR level profile use is on.
Definition CodeGenOptions.h:199