File indexing completed on 2026-05-10 08:43:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef LLVM_CODEGEN_COMMANDFLAGS_H
0016 #define LLVM_CODEGEN_COMMANDFLAGS_H
0017
0018 #include "llvm/ADT/FloatingPointMode.h"
0019 #include "llvm/Support/CodeGen.h"
0020 #include "llvm/Target/TargetOptions.h"
0021 #include <optional>
0022 #include <string>
0023 #include <vector>
0024
0025 namespace llvm {
0026
0027 class Module;
0028 class AttrBuilder;
0029 class Function;
0030 class Triple;
0031 class TargetMachine;
0032
0033 namespace codegen {
0034
0035 std::string getMArch();
0036
0037 std::string getMCPU();
0038
0039 std::vector<std::string> getMAttrs();
0040
0041 Reloc::Model getRelocModel();
0042 std::optional<Reloc::Model> getExplicitRelocModel();
0043
0044 ThreadModel::Model getThreadModel();
0045
0046 CodeModel::Model getCodeModel();
0047 std::optional<CodeModel::Model> getExplicitCodeModel();
0048
0049 uint64_t getLargeDataThreshold();
0050 std::optional<uint64_t> getExplicitLargeDataThreshold();
0051
0052 llvm::ExceptionHandling getExceptionModel();
0053
0054 std::optional<CodeGenFileType> getExplicitFileType();
0055
0056 CodeGenFileType getFileType();
0057
0058 FramePointerKind getFramePointerUsage();
0059
0060 bool getEnableUnsafeFPMath();
0061
0062 bool getEnableNoInfsFPMath();
0063
0064 bool getEnableNoNaNsFPMath();
0065
0066 bool getEnableNoSignedZerosFPMath();
0067
0068 bool getEnableApproxFuncFPMath();
0069
0070 bool getEnableNoTrappingFPMath();
0071
0072 DenormalMode::DenormalModeKind getDenormalFPMath();
0073 DenormalMode::DenormalModeKind getDenormalFP32Math();
0074
0075 bool getEnableHonorSignDependentRoundingFPMath();
0076
0077 llvm::FloatABI::ABIType getFloatABIForCalls();
0078
0079 llvm::FPOpFusion::FPOpFusionMode getFuseFPOps();
0080
0081 SwiftAsyncFramePointerMode getSwiftAsyncFramePointer();
0082
0083 bool getDontPlaceZerosInBSS();
0084
0085 bool getEnableGuaranteedTailCallOpt();
0086
0087 bool getEnableAIXExtendedAltivecABI();
0088
0089 bool getDisableTailCalls();
0090
0091 bool getStackSymbolOrdering();
0092
0093 bool getStackRealign();
0094
0095 std::string getTrapFuncName();
0096
0097 bool getUseCtors();
0098
0099 bool getDisableIntegratedAS();
0100
0101 bool getDataSections();
0102 std::optional<bool> getExplicitDataSections();
0103
0104 bool getFunctionSections();
0105 std::optional<bool> getExplicitFunctionSections();
0106
0107 bool getIgnoreXCOFFVisibility();
0108
0109 bool getXCOFFTracebackTable();
0110
0111 std::string getBBSections();
0112
0113 unsigned getTLSSize();
0114
0115 bool getEmulatedTLS();
0116 std::optional<bool> getExplicitEmulatedTLS();
0117
0118 bool getEnableTLSDESC();
0119 std::optional<bool> getExplicitEnableTLSDESC();
0120
0121 bool getUniqueSectionNames();
0122
0123 bool getUniqueBasicBlockSectionNames();
0124
0125 bool getSeparateNamedSections();
0126
0127 llvm::EABI getEABIVersion();
0128
0129 llvm::DebuggerKind getDebuggerTuningOpt();
0130
0131 bool getEnableStackSizeSection();
0132
0133 bool getEnableAddrsig();
0134
0135 bool getEmitCallSiteInfo();
0136
0137 bool getEnableMachineFunctionSplitter();
0138
0139 bool getEnableDebugEntryValues();
0140
0141 bool getValueTrackingVariableLocations();
0142 std::optional<bool> getExplicitValueTrackingVariableLocations();
0143
0144 bool getForceDwarfFrameSection();
0145
0146 bool getXRayFunctionIndex();
0147
0148 bool getDebugStrictDwarf();
0149
0150 unsigned getAlignLoops();
0151
0152 bool getJMCInstrument();
0153
0154 bool getXCOFFReadOnlyPointers();
0155
0156
0157
0158 struct RegisterCodeGenFlags {
0159 RegisterCodeGenFlags();
0160 };
0161
0162 bool getEnableBBAddrMap();
0163
0164 llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
0165
0166
0167
0168
0169
0170
0171
0172 TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple);
0173
0174 std::string getCPUStr();
0175
0176 std::string getFeaturesStr();
0177
0178 std::vector<std::string> getFeatureList();
0179
0180 void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val);
0181
0182
0183
0184 void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
0185
0186
0187
0188 void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
0189
0190
0191
0192 bool getDefaultValueTrackingVariableLocations(const llvm::Triple &T);
0193
0194
0195
0196
0197 Expected<std::unique_ptr<TargetMachine>> createTargetMachineForTriple(
0198 StringRef TargetTriple,
0199 CodeGenOptLevel OptLevel = CodeGenOptLevel::Default);
0200
0201 }
0202 }
0203
0204 #endif