Debian Codegraph @

suite/synctools/tablegen/include/llvm/CodeGen/CommandFlags.h

raw symbols SCIP
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
18 #include "llvm/ADT/FloatingPointMode.h"
19 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/ADT/Triple.h"
21 #include "llvm/IR/Instructions.h"
22 #include "llvm/IR/Intrinsics.h"
23 #include "llvm/MC/MCTargetOptionsCommandFlags.h"
24 #include "llvm/Support/CodeGen.h"
25 #include "llvm/Target/TargetOptions.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
41 Reloc::Model getRelocModel();
42 Optional<Reloc::Model> getExplicitRelocModel();
43
44 ThreadModel::Model getThreadModel();
45
46 CodeModel::Model getCodeModel();
47 Optional<CodeModel::Model> getExplicitCodeModel();
48
49 llvm::ExceptionHandling getExceptionModel();
50
51 Optional<CodeGenFileType> getExplicitFileType();
52
53 CodeGenFileType getFileType();
54
55 FramePointerKind getFramePointerUsage();
56
57 bool getEnableUnsafeFPMath();
58
59 bool getEnableNoInfsFPMath();
60
61 bool getEnableNoNaNsFPMath();
62
63 bool getEnableNoSignedZerosFPMath();
64
65 bool getEnableNoTrappingFPMath();
66
67 DenormalMode::DenormalModeKind getDenormalFPMath();
68 DenormalMode::DenormalModeKind getDenormalFP32Math();
69
70 bool getEnableHonorSignDependentRoundingFPMath();
71
72 llvm::FloatABI::ABIType getFloatABIForCalls();
73
74 llvm::FPOpFusion::FPOpFusionMode getFuseFPOps();
75
76 SwiftAsyncFramePointerMode getSwiftAsyncFramePointer();
77
78 bool getDontPlaceZerosInBSS();
79
80 bool getEnableGuaranteedTailCallOpt();
81
82 bool getEnableAIXExtendedAltivecABI();
83
84 bool getDisableTailCalls();
85
86 bool getStackSymbolOrdering();
87
88 unsigned getOverrideStackAlignment();
89
90 bool getStackRealign();
91
92 std::string getTrapFuncName();
93
94 bool getUseCtors();
95
96 bool getRelaxELFRelocations();
97
98 bool getDataSections();
99 Optional<bool> getExplicitDataSections();
100
101 bool getFunctionSections();
102 Optional<bool> getExplicitFunctionSections();
103
104 bool getIgnoreXCOFFVisibility();
105
106 bool getXCOFFTracebackTable();
107
108 std::string getBBSections();
109
110 unsigned getTLSSize();
111
112 bool getEmulatedTLS();
113
114 bool getUniqueSectionNames();
115
116 bool getUniqueBasicBlockSectionNames();
117
118 llvm::EABI getEABIVersion();
119
120 llvm::DebuggerKind getDebuggerTuningOpt();
121
122 bool getEnableStackSizeSection();
123
124 bool getEnableAddrsig();
125
126 bool getEmitCallSiteInfo();
127
128 bool getEnableMachineFunctionSplitter();
129
130 bool getEnableDebugEntryValues();
131
132 bool getValueTrackingVariableLocations();
133 Optional<bool> getExplicitValueTrackingVariableLocations();
134
135 bool getForceDwarfFrameSection();
136
137 bool getXRayOmitFunctionIndex();
138
139 bool getDebugStrictDwarf();
140
141 unsigned getAlignLoops();
142
143 /// Create this object with static storage to register codegen-related command
144 /// line options.
145 struct RegisterCodeGenFlags {
146 RegisterCodeGenFlags();
147 };
148
149 llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
150
151 /// Common utility function tightly tied to the options listed here. Initializes
152 /// a TargetOptions object with CodeGen flags and returns it.
153 /// \p TheTriple is used to determine the default value for options if
154 /// options are not explicitly specified. If those triple dependant options
155 /// value do not have effect for your component, a default Triple() could be
156 /// passed in.
157 TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple);
158
159 std::string getCPUStr();
160
161 std::string getFeaturesStr();
162
163 std::vector<std::string> getFeatureList();
164
165 void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val);
166
167 /// Set function attributes of function \p F based on CPU, Features, and command
168 /// line flags.
169 void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
170
171 /// Set function attributes of functions in Module M based on CPU,
172 /// Features, and command line flags.
173 void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
174
175 /// Should value-tracking variable locations / instruction referencing be
176 /// enabled by default for this triple?
177 bool getDefaultValueTrackingVariableLocations(const llvm::Triple &T);
178 } // namespace codegen
179 } // namespace llvm
180
181 #endif // LLVM_CODEGEN_COMMANDFLAGS_H