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 
53 
55 
57 
59 
61 
63 
65 
67 
70 
72 
74 
76 
78 
80 
82 
84 
85 bool getDisableTailCalls();
86 
88 
89 unsigned getOverrideStackAlignment();
90 
91 bool getStackRealign();
92 
93 std::string getTrapFuncName();
94 
95 bool getUseCtors();
96 
98 
99 bool getDataSections();
101 
102 bool getFunctionSections();
104 
106 
108 
109 std::string getBBSections();
110 
111 unsigned getTLSSize();
112 
113 bool getEmulatedTLS();
114 
115 bool getUniqueSectionNames();
116 
118 
120 
122 
124 
125 bool getEnableAddrsig();
126 
127 bool getEmitCallSiteInfo();
128 
130 
132 
134 
136 
138 
140 
141 bool getDebugStrictDwarf();
142 
143 unsigned getAlignLoops();
144 
145 /// Create this object with static storage to register codegen-related command
146 /// line options.
149 };
150 
152 
153 /// Common utility function tightly tied to the options listed here. Initializes
154 /// a TargetOptions object with CodeGen flags and returns it.
155 /// \p TheTriple is used to determine the default value for options if
156 /// options are not explicitly specified. If those triple dependant options
157 /// value do not have effect for your component, a default Triple() could be
158 /// passed in.
160 
161 std::string getCPUStr();
162 
163 std::string getFeaturesStr();
164 
165 std::vector<std::string> getFeatureList();
166 
168 
169 /// Set function attributes of function \p F based on CPU, Features, and command
170 /// line flags.
171 void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
172 
173 /// Set function attributes of functions in Module M based on CPU,
174 /// Features, and command line flags.
175 void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
176 } // namespace codegen
177 } // namespace llvm
178 
179 #endif // LLVM_CODEGEN_COMMANDFLAGS_H
llvm::codegen::getDenormalFP32Math
DenormalMode::DenormalModeKind getDenormalFP32Math()
llvm::codegen::getMArch
std::string getMArch()
FloatingPointMode.h
llvm
---------------------— PointerInfo ------------------------------------—
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:61
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:502
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:100
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:569
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:479
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:609
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:589
llvm::codegen::getEmulatedTLS
bool getEmulatedTLS()
llvm::codegen::getTLSSize
unsigned getTLSSize()
llvm::AttrBuilder
Definition: Attributes.h:907
StringExtras.h
llvm::codegen::getExplicitFileType
Optional< CodeGenFileType > getExplicitFileType()
llvm::codegen::getCPUStr
std::string getCPUStr()
Definition: CommandFlags.cpp:559
llvm::codegen::getExplicitFunctionSections
Optional< bool > getExplicitFunctionSections()
llvm::codegen::getUniqueBasicBlockSectionNames
bool getUniqueBasicBlockSectionNames()
llvm::codegen::getPseudoProbeForProfiling
bool getPseudoProbeForProfiling()
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:621
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:147
llvm::codegen::getBBSections
std::string getBBSections()
llvm::codegen::getFramePointerUsage
FramePointerKind getFramePointerUsage()