LLVM  14.0.0git
CommandFlags.h
Go to the documentation of this file.
1 //===-- CommandFlags.h - Command Line Flags Interface -----------*- 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 contains codegen-specific flags that are shared between different
10 // command line tools. The tools "llc" and "opt" both use this file to prevent
11 // flag duplication.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_COMMANDFLAGS_H
16 #define LLVM_CODEGEN_COMMANDFLAGS_H
17 
19 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/ADT/Triple.h"
21 #include "llvm/IR/Instructions.h"
22 #include "llvm/IR/Intrinsics.h"
24 #include "llvm/Support/CodeGen.h"
26 #include <string>
27 #include <vector>
28 
29 namespace llvm {
30 
31 class Module;
32 
33 namespace codegen {
34 
35 std::string getMArch();
36 
37 std::string getMCPU();
38 
39 std::vector<std::string> getMAttrs();
40 
43 
45 
48 
50 
52 
54 
56 
58 
60 
62 
64 
66 
69 
71 
73 
75 
77 
79 
81 
83 
84 bool getDisableTailCalls();
85 
87 
88 unsigned getOverrideStackAlignment();
89 
90 bool getStackRealign();
91 
92 std::string getTrapFuncName();
93 
94 bool getUseCtors();
95 
97 
98 bool getDataSections();
100 
101 bool getFunctionSections();
103 
105 
107 
108 std::string getBBSections();
109 
110 unsigned getTLSSize();
111 
112 bool getEmulatedTLS();
113 
114 bool getUniqueSectionNames();
115 
117 
119 
121 
123 
124 bool getEnableAddrsig();
125 
126 bool getEmitCallSiteInfo();
127 
129 
131 
133 
135 
137 
138 bool getDebugStrictDwarf();
139 
140 unsigned getAlignLoops();
141 
142 /// Create this object with static storage to register codegen-related command
143 /// line options.
146 };
147 
149 
150 /// Common utility function tightly tied to the options listed here. Initializes
151 /// a TargetOptions object with CodeGen flags and returns it.
152 /// \p TheTriple is used to determine the default value for options if
153 /// options are not explicitly specified. If those triple dependant options
154 /// value do not have effect for your component, a default Triple() could be
155 /// passed in.
157 
158 std::string getCPUStr();
159 
160 std::string getFeaturesStr();
161 
162 std::vector<std::string> getFeatureList();
163 
165 
166 /// Set function attributes of function \p F based on CPU, Features, and command
167 /// line flags.
168 void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
169 
170 /// Set function attributes of functions in Module M based on CPU,
171 /// Features, and command line flags.
172 void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
173 } // namespace codegen
174 } // namespace llvm
175 
176 #endif // LLVM_CODEGEN_COMMANDFLAGS_H
llvm::codegen::getDenormalFP32Math
DenormalMode::DenormalModeKind getDenormalFP32Math()
llvm::codegen::getMArch
std::string getMArch()
FloatingPointMode.h
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::codegen::getDontPlaceZerosInBSS
bool getDontPlaceZerosInBSS()
llvm::DebuggerKind
DebuggerKind
Identify a debugger for "tuning" the debug info.
Definition: TargetOptions.h:97
llvm::TargetOptions
Definition: TargetOptions.h:124
llvm::Function
Definition: Function.h:62
llvm::codegen::getDisableTailCalls
bool getDisableTailCalls()
llvm::codegen::getExplicitDataSections
Optional< bool > getExplicitDataSections()
codegen
Since we know that Vector is byte aligned and we know the element offset of we should change the load into a lve *x instead of doing a load store lve *x sequence Implement passing vectors by value into calls and receiving them as arguments GCC apparently tries to codegen
Definition: README_ALTIVEC.txt:46
llvm::codegen::InitTargetOptionsFromCodeGenFlags
TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple)
Common utility function tightly tied to the options listed here.
Definition: CommandFlags.cpp:496
llvm::codegen::getOverrideStackAlignment
unsigned getOverrideStackAlignment()
llvm::codegen::getUseCtors
bool getUseCtors()
llvm::codegen::getEnableNoTrappingFPMath
bool getEnableNoTrappingFPMath()
llvm::codegen::getStackRealign
bool getStackRealign()
MCTargetOptionsCommandFlags.h
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::codegen::RegisterCodeGenFlags::RegisterCodeGenFlags
RegisterCodeGenFlags()
Definition: CommandFlags.cpp:99
llvm::codegen::getTrapFuncName
std::string getTrapFuncName()
llvm::FloatABI::ABIType
ABIType
Definition: TargetOptions.h:28
llvm::codegen::getExceptionModel
llvm::ExceptionHandling getExceptionModel()
llvm::codegen::getDenormalFPMath
DenormalMode::DenormalModeKind getDenormalFPMath()
llvm::FPOpFusion::FPOpFusionMode
FPOpFusionMode
Definition: TargetOptions.h:36
llvm::Optional< Reloc::Model >
llvm::codegen::getFeaturesStr
std::string getFeaturesStr()
Definition: CommandFlags.cpp:562
llvm::codegen::getEnableMachineFunctionSplitter
bool getEnableMachineFunctionSplitter()
llvm::codegen::getMCPU
std::string getMCPU()
llvm::codegen::getEnableNoSignedZerosFPMath
bool getEnableNoSignedZerosFPMath()
llvm::codegen::getFloatABIForCalls
llvm::FloatABI::ABIType getFloatABIForCalls()
llvm::codegen::getEnableAddrsig
bool getEnableAddrsig()
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::Reloc::Model
Model
Definition: CodeGen.h:22
llvm::codegen::getFunctionSections
bool getFunctionSections()
llvm::codegen::getStackSymbolOrdering
bool getStackSymbolOrdering()
llvm::codegen::getAlignLoops
unsigned getAlignLoops()
llvm::codegen::getXRayOmitFunctionIndex
bool getXRayOmitFunctionIndex()
llvm::codegen::getBBSectionsMode
llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options)
Definition: CommandFlags.cpp:473
llvm::ExceptionHandling
ExceptionHandling
Definition: MCTargetOptions.h:18
Intrinsics.h
llvm::codegen::getDebuggerTuningOpt
llvm::DebuggerKind getDebuggerTuningOpt()
llvm::codegen::renderBoolStringAttr
void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val)
Definition: CommandFlags.cpp:602
llvm::codegen::getSwiftAsyncFramePointer
SwiftAsyncFramePointerMode getSwiftAsyncFramePointer()
llvm::codegen::getThreadModel
ThreadModel::Model getThreadModel()
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::codegen::getExplicitCodeModel
Optional< CodeModel::Model > getExplicitCodeModel()
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::codegen::getEnableUnsafeFPMath
bool getEnableUnsafeFPMath()
llvm::codegen::getEnableNoNaNsFPMath
bool getEnableNoNaNsFPMath()
llvm::DenormalMode::DenormalModeKind
DenormalModeKind
Represent handled modes for denormal (aka subnormal) modes in the floating point environment.
Definition: FloatingPointMode.h:70
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
llvm::codegen::getEnableGuaranteedTailCallOpt
bool getEnableGuaranteedTailCallOpt()
llvm::codegen::getIgnoreXCOFFVisibility
bool getIgnoreXCOFFVisibility()
llvm::codegen::getEnableNoInfsFPMath
bool getEnableNoInfsFPMath()
llvm::codegen::getEnableHonorSignDependentRoundingFPMath
bool getEnableHonorSignDependentRoundingFPMath()
llvm::codegen::getEnableStackSizeSection
bool getEnableStackSizeSection()
llvm::codegen::getFeatureList
std::vector< std::string > getFeatureList()
Definition: CommandFlags.cpp:582
llvm::codegen::getEmulatedTLS
bool getEmulatedTLS()
llvm::codegen::getTLSSize
unsigned getTLSSize()
llvm::AttrBuilder
Definition: Attributes.h:931
StringExtras.h
llvm::codegen::getExplicitFileType
Optional< CodeGenFileType > getExplicitFileType()
llvm::codegen::getCPUStr
std::string getCPUStr()
Definition: CommandFlags.cpp:552
llvm::codegen::getExplicitFunctionSections
Optional< bool > getExplicitFunctionSections()
llvm::codegen::getUniqueBasicBlockSectionNames
bool getUniqueBasicBlockSectionNames()
llvm::FramePointerKind
FramePointerKind
Definition: CodeGen.h:70
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
Triple.h
llvm::codegen::getRelocModel
Reloc::Model getRelocModel()
llvm::codegen::getMAttrs
std::vector< std::string > getMAttrs()
TargetOptions.h
llvm::codegen::getEABIVersion
llvm::EABI getEABIVersion()
llvm::CodeGenFileType
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
Definition: CodeGen.h:63
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::codegen::getFuseFPOps
llvm::FPOpFusion::FPOpFusionMode getFuseFPOps()
llvm::codegen::getDataSections
bool getDataSections()
llvm::codegen::setFunctionAttributes
void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F)
Set function attributes of function F based on CPU, Features, and command line flags.
Definition: CommandFlags.cpp:614
llvm::codegen::getDebugStrictDwarf
bool getDebugStrictDwarf()
llvm::codegen::getRelaxELFRelocations
bool getRelaxELFRelocations()
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::codegen::getUniqueSectionNames
bool getUniqueSectionNames()
llvm::codegen::getValueTrackingVariableLocations
bool getValueTrackingVariableLocations()
llvm::codegen::getEnableDebugEntryValues
bool getEnableDebugEntryValues()
llvm::codegen::getEmitCallSiteInfo
bool getEmitCallSiteInfo()
CodeGen.h
Instructions.h
llvm::BasicBlockSection
BasicBlockSection
Definition: TargetOptions.h:61
llvm::ThreadModel::Model
Model
Definition: TargetOptions.h:55
llvm::codegen::getFileType
CodeGenFileType getFileType()
llvm::codegen::getForceDwarfFrameSection
bool getForceDwarfFrameSection()
llvm::codegen::getXCOFFTracebackTable
bool getXCOFFTracebackTable()
llvm::codegen::getExplicitRelocModel
Optional< Reloc::Model > getExplicitRelocModel()
llvm::codegen::getEnableAIXExtendedAltivecABI
bool getEnableAIXExtendedAltivecABI()
llvm::SwiftAsyncFramePointerMode
SwiftAsyncFramePointerMode
Indicates when and how the Swift async frame pointer bit should be set.
Definition: TargetOptions.h:114
llvm::EABI
EABI
Definition: TargetOptions.h:76
llvm::codegen::getCodeModel
CodeModel::Model getCodeModel()
llvm::codegen::RegisterCodeGenFlags
Create this object with static storage to register codegen-related command line options.
Definition: CommandFlags.h:144
llvm::codegen::getBBSections
std::string getBBSections()
llvm::codegen::getFramePointerUsage
FramePointerKind getFramePointerUsage()