LLVM 22.0.0git
Classes | Functions
llvm::codegen Namespace Reference

Classes

struct  RegisterCodeGenFlags
 Create this object with static storage to register codegen-related command line options. More...
 

Functions

LLVM_ABI std::string getMArch ()
 
LLVM_ABI std::string getMCPU ()
 
LLVM_ABI std::vector< std::string > getMAttrs ()
 
LLVM_ABI Reloc::Model getRelocModel ()
 
LLVM_ABI std::optional< Reloc::ModelgetExplicitRelocModel ()
 
LLVM_ABI ThreadModel::Model getThreadModel ()
 
LLVM_ABI CodeModel::Model getCodeModel ()
 
LLVM_ABI std::optional< CodeModel::ModelgetExplicitCodeModel ()
 
LLVM_ABI uint64_t getLargeDataThreshold ()
 
LLVM_ABI std::optional< uint64_tgetExplicitLargeDataThreshold ()
 
LLVM_ABI llvm::ExceptionHandling getExceptionModel ()
 
LLVM_ABI std::optional< CodeGenFileTypegetExplicitFileType ()
 
LLVM_ABI CodeGenFileType getFileType ()
 
LLVM_ABI FramePointerKind getFramePointerUsage ()
 
LLVM_ABI bool getEnableUnsafeFPMath ()
 
LLVM_ABI bool getEnableNoInfsFPMath ()
 
LLVM_ABI bool getEnableNoNaNsFPMath ()
 
LLVM_ABI bool getEnableNoSignedZerosFPMath ()
 
LLVM_ABI bool getEnableNoTrappingFPMath ()
 
LLVM_ABI DenormalMode::DenormalModeKind getDenormalFPMath ()
 
LLVM_ABI DenormalMode::DenormalModeKind getDenormalFP32Math ()
 
LLVM_ABI bool getEnableHonorSignDependentRoundingFPMath ()
 
LLVM_ABI llvm::FloatABI::ABIType getFloatABIForCalls ()
 
LLVM_ABI llvm::FPOpFusion::FPOpFusionMode getFuseFPOps ()
 
LLVM_ABI SwiftAsyncFramePointerMode getSwiftAsyncFramePointer ()
 
LLVM_ABI bool getDontPlaceZerosInBSS ()
 
LLVM_ABI bool getEnableGuaranteedTailCallOpt ()
 
LLVM_ABI bool getEnableAIXExtendedAltivecABI ()
 
LLVM_ABI bool getDisableTailCalls ()
 
LLVM_ABI bool getStackSymbolOrdering ()
 
LLVM_ABI bool getStackRealign ()
 
LLVM_ABI std::string getTrapFuncName ()
 
LLVM_ABI bool getUseCtors ()
 
LLVM_ABI bool getDisableIntegratedAS ()
 
LLVM_ABI bool getDataSections ()
 
LLVM_ABI std::optional< boolgetExplicitDataSections ()
 
LLVM_ABI bool getFunctionSections ()
 
LLVM_ABI std::optional< boolgetExplicitFunctionSections ()
 
LLVM_ABI bool getIgnoreXCOFFVisibility ()
 
LLVM_ABI bool getXCOFFTracebackTable ()
 
LLVM_ABI std::string getBBSections ()
 
LLVM_ABI unsigned getTLSSize ()
 
LLVM_ABI bool getEmulatedTLS ()
 
LLVM_ABI std::optional< boolgetExplicitEmulatedTLS ()
 
LLVM_ABI bool getEnableTLSDESC ()
 
LLVM_ABI std::optional< boolgetExplicitEnableTLSDESC ()
 
LLVM_ABI bool getUniqueSectionNames ()
 
LLVM_ABI bool getUniqueBasicBlockSectionNames ()
 
LLVM_ABI bool getSeparateNamedSections ()
 
LLVM_ABI llvm::EABI getEABIVersion ()
 
LLVM_ABI llvm::DebuggerKind getDebuggerTuningOpt ()
 
LLVM_ABI bool getEnableStackSizeSection ()
 
LLVM_ABI bool getEnableAddrsig ()
 
LLVM_ABI bool getEnableCallGraphSection ()
 
LLVM_ABI bool getEmitCallSiteInfo ()
 
LLVM_ABI bool getEnableMachineFunctionSplitter ()
 
LLVM_ABI bool getEnableStaticDataPartitioning ()
 
LLVM_ABI bool getEnableDebugEntryValues ()
 
LLVM_ABI bool getValueTrackingVariableLocations ()
 
LLVM_ABI std::optional< boolgetExplicitValueTrackingVariableLocations ()
 
LLVM_ABI bool getForceDwarfFrameSection ()
 
LLVM_ABI bool getXRayFunctionIndex ()
 
LLVM_ABI bool getDebugStrictDwarf ()
 
LLVM_ABI unsigned getAlignLoops ()
 
LLVM_ABI bool getJMCInstrument ()
 
LLVM_ABI bool getXCOFFReadOnlyPointers ()
 
LLVM_ABI bool getEnableBBAddrMap ()
 
LLVM_ABI llvm::BasicBlockSection getBBSectionsMode (llvm::TargetOptions &Options)
 
LLVM_ABI TargetOptions InitTargetOptionsFromCodeGenFlags (const llvm::Triple &TheTriple)
 Common utility function tightly tied to the options listed here.
 
LLVM_ABI std::string getCPUStr ()
 
LLVM_ABI std::string getFeaturesStr ()
 
LLVM_ABI std::vector< std::string > getFeatureList ()
 
LLVM_ABI void renderBoolStringAttr (AttrBuilder &B, StringRef Name, bool Val)
 
LLVM_ABI void setFunctionAttributes (StringRef CPU, StringRef Features, Function &F)
 Set function attributes of function F based on CPU, Features, and command line flags.
 
LLVM_ABI void setFunctionAttributes (StringRef CPU, StringRef Features, Module &M)
 Set function attributes of functions in Module M based on CPU, Features, and command line flags.
 
LLVM_ABI bool getDefaultValueTrackingVariableLocations (const llvm::Triple &T)
 Should value-tracking variable locations / instruction referencing be enabled by default for this triple?
 
LLVM_ABI Expected< std::unique_ptr< TargetMachine > > createTargetMachineForTriple (StringRef TargetTriple, CodeGenOptLevel OptLevel=CodeGenOptLevel::Default)
 Creates a TargetMachine instance with the options defined on the command line.
 

Function Documentation

◆ createTargetMachineForTriple()

Expected< std::unique_ptr< TargetMachine > > llvm::codegen::createTargetMachineForTriple ( StringRef  TargetTriple,
CodeGenOptLevel  OptLevel = CodeGenOptLevel::Default 
)

Creates a TargetMachine instance with the options defined on the command line.

This can be used for tools that do not need further customization of the TargetOptions.

Definition at line 756 of file CommandFlags.cpp.

References llvm::createStringError(), llvm::Target::createTargetMachine(), getCPUStr(), getExplicitCodeModel(), getExplicitRelocModel(), getFeaturesStr(), getMArch(), llvm::inconvertibleErrorCode(), InitTargetOptionsFromCodeGenFlags(), and llvm::TargetRegistry::lookupTarget().

◆ getAlignLoops()

LLVM_ABI unsigned llvm::codegen::getAlignLoops ( )

◆ getBBSections()

LLVM_ABI std::string llvm::codegen::getBBSections ( )

Referenced by getBBSectionsMode().

◆ getBBSectionsMode()

llvm::BasicBlockSection llvm::codegen::getBBSectionsMode ( llvm::TargetOptions Options)

◆ getCodeModel()

LLVM_ABI CodeModel::Model llvm::codegen::getCodeModel ( )

◆ getCPUStr()

std::string llvm::codegen::getCPUStr ( )

Definition at line 615 of file CommandFlags.cpp.

References llvm::sys::getHostCPUName(), and getMCPU().

Referenced by createTargetMachineForTriple().

◆ getDataSections()

LLVM_ABI bool llvm::codegen::getDataSections ( )

◆ getDebuggerTuningOpt()

LLVM_ABI llvm::DebuggerKind llvm::codegen::getDebuggerTuningOpt ( )

◆ getDebugStrictDwarf()

LLVM_ABI bool llvm::codegen::getDebugStrictDwarf ( )

◆ getDefaultValueTrackingVariableLocations()

LLVM_ABI bool llvm::codegen::getDefaultValueTrackingVariableLocations ( const llvm::Triple T)

Should value-tracking variable locations / instruction referencing be enabled by default for this triple?

◆ getDenormalFP32Math()

LLVM_ABI DenormalMode::DenormalModeKind llvm::codegen::getDenormalFP32Math ( )

Referenced by setFunctionAttributes().

◆ getDenormalFPMath()

LLVM_ABI DenormalMode::DenormalModeKind llvm::codegen::getDenormalFPMath ( )

◆ getDisableIntegratedAS()

LLVM_ABI bool llvm::codegen::getDisableIntegratedAS ( )

◆ getDisableTailCalls()

LLVM_ABI bool llvm::codegen::getDisableTailCalls ( )

Referenced by setFunctionAttributes().

◆ getDontPlaceZerosInBSS()

LLVM_ABI bool llvm::codegen::getDontPlaceZerosInBSS ( )

◆ getEABIVersion()

LLVM_ABI llvm::EABI llvm::codegen::getEABIVersion ( )

◆ getEmitCallSiteInfo()

LLVM_ABI bool llvm::codegen::getEmitCallSiteInfo ( )

◆ getEmulatedTLS()

LLVM_ABI bool llvm::codegen::getEmulatedTLS ( )

◆ getEnableAddrsig()

LLVM_ABI bool llvm::codegen::getEnableAddrsig ( )

◆ getEnableAIXExtendedAltivecABI()

LLVM_ABI bool llvm::codegen::getEnableAIXExtendedAltivecABI ( )

◆ getEnableBBAddrMap()

LLVM_ABI bool llvm::codegen::getEnableBBAddrMap ( )

◆ getEnableCallGraphSection()

LLVM_ABI bool llvm::codegen::getEnableCallGraphSection ( )

◆ getEnableDebugEntryValues()

LLVM_ABI bool llvm::codegen::getEnableDebugEntryValues ( )

◆ getEnableGuaranteedTailCallOpt()

LLVM_ABI bool llvm::codegen::getEnableGuaranteedTailCallOpt ( )

◆ getEnableHonorSignDependentRoundingFPMath()

LLVM_ABI bool llvm::codegen::getEnableHonorSignDependentRoundingFPMath ( )

◆ getEnableMachineFunctionSplitter()

LLVM_ABI bool llvm::codegen::getEnableMachineFunctionSplitter ( )

◆ getEnableNoInfsFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoInfsFPMath ( )

◆ getEnableNoNaNsFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoNaNsFPMath ( )

◆ getEnableNoSignedZerosFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoSignedZerosFPMath ( )

◆ getEnableNoTrappingFPMath()

LLVM_ABI bool llvm::codegen::getEnableNoTrappingFPMath ( )

◆ getEnableStackSizeSection()

LLVM_ABI bool llvm::codegen::getEnableStackSizeSection ( )

◆ getEnableStaticDataPartitioning()

LLVM_ABI bool llvm::codegen::getEnableStaticDataPartitioning ( )

◆ getEnableTLSDESC()

LLVM_ABI bool llvm::codegen::getEnableTLSDESC ( )

◆ getEnableUnsafeFPMath()

LLVM_ABI bool llvm::codegen::getEnableUnsafeFPMath ( )

◆ getExceptionModel()

LLVM_ABI llvm::ExceptionHandling llvm::codegen::getExceptionModel ( )

◆ getExplicitCodeModel()

LLVM_ABI std::optional< CodeModel::Model > llvm::codegen::getExplicitCodeModel ( )

◆ getExplicitDataSections()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitDataSections ( )

◆ getExplicitEmulatedTLS()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitEmulatedTLS ( )

◆ getExplicitEnableTLSDESC()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitEnableTLSDESC ( )

◆ getExplicitFileType()

LLVM_ABI std::optional< CodeGenFileType > llvm::codegen::getExplicitFileType ( )

◆ getExplicitFunctionSections()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitFunctionSections ( )

◆ getExplicitLargeDataThreshold()

LLVM_ABI std::optional< uint64_t > llvm::codegen::getExplicitLargeDataThreshold ( )

◆ getExplicitRelocModel()

LLVM_ABI std::optional< Reloc::Model > llvm::codegen::getExplicitRelocModel ( )

◆ getExplicitValueTrackingVariableLocations()

LLVM_ABI std::optional< bool > llvm::codegen::getExplicitValueTrackingVariableLocations ( )

◆ getFeatureList()

std::vector< std::string > llvm::codegen::getFeatureList ( )

◆ getFeaturesStr()

std::string llvm::codegen::getFeaturesStr ( )

◆ getFileType()

LLVM_ABI CodeGenFileType llvm::codegen::getFileType ( )

◆ getFloatABIForCalls()

LLVM_ABI llvm::FloatABI::ABIType llvm::codegen::getFloatABIForCalls ( )

◆ getForceDwarfFrameSection()

LLVM_ABI bool llvm::codegen::getForceDwarfFrameSection ( )

◆ getFramePointerUsage()

LLVM_ABI FramePointerKind llvm::codegen::getFramePointerUsage ( )

Referenced by setFunctionAttributes().

◆ getFunctionSections()

LLVM_ABI bool llvm::codegen::getFunctionSections ( )

◆ getFuseFPOps()

LLVM_ABI llvm::FPOpFusion::FPOpFusionMode llvm::codegen::getFuseFPOps ( )

◆ getIgnoreXCOFFVisibility()

LLVM_ABI bool llvm::codegen::getIgnoreXCOFFVisibility ( )

◆ getJMCInstrument()

LLVM_ABI bool llvm::codegen::getJMCInstrument ( )

◆ getLargeDataThreshold()

LLVM_ABI uint64_t llvm::codegen::getLargeDataThreshold ( )

◆ getMArch()

LLVM_ABI std::string llvm::codegen::getMArch ( )

◆ getMAttrs()

LLVM_ABI std::vector< std::string > llvm::codegen::getMAttrs ( )

Referenced by getFeatureList(), and getFeaturesStr().

◆ getMCPU()

LLVM_ABI std::string llvm::codegen::getMCPU ( )

◆ getRelocModel()

LLVM_ABI Reloc::Model llvm::codegen::getRelocModel ( )

◆ getSeparateNamedSections()

LLVM_ABI bool llvm::codegen::getSeparateNamedSections ( )

◆ getStackRealign()

LLVM_ABI bool llvm::codegen::getStackRealign ( )

Referenced by setFunctionAttributes().

◆ getStackSymbolOrdering()

LLVM_ABI bool llvm::codegen::getStackSymbolOrdering ( )

◆ getSwiftAsyncFramePointer()

LLVM_ABI SwiftAsyncFramePointerMode llvm::codegen::getSwiftAsyncFramePointer ( )

◆ getThreadModel()

LLVM_ABI ThreadModel::Model llvm::codegen::getThreadModel ( )

◆ getTLSSize()

LLVM_ABI unsigned llvm::codegen::getTLSSize ( )

◆ getTrapFuncName()

LLVM_ABI std::string llvm::codegen::getTrapFuncName ( )

Referenced by setFunctionAttributes().

◆ getUniqueBasicBlockSectionNames()

LLVM_ABI bool llvm::codegen::getUniqueBasicBlockSectionNames ( )

◆ getUniqueSectionNames()

LLVM_ABI bool llvm::codegen::getUniqueSectionNames ( )

◆ getUseCtors()

LLVM_ABI bool llvm::codegen::getUseCtors ( )

◆ getValueTrackingVariableLocations()

LLVM_ABI bool llvm::codegen::getValueTrackingVariableLocations ( )

◆ getXCOFFReadOnlyPointers()

LLVM_ABI bool llvm::codegen::getXCOFFReadOnlyPointers ( )

◆ getXCOFFTracebackTable()

LLVM_ABI bool llvm::codegen::getXCOFFTracebackTable ( )

◆ getXRayFunctionIndex()

LLVM_ABI bool llvm::codegen::getXRayFunctionIndex ( )

◆ InitTargetOptionsFromCodeGenFlags()

TargetOptions llvm::codegen::InitTargetOptionsFromCodeGenFlags ( const llvm::Triple TheTriple)

Common utility function tightly tied to the options listed here.

Initializes a TargetOptions object with CodeGen flags and returns it. TheTriple is used to determine the default value for options if options are not explicitly specified. If those triple dependant options value do not have effect for your component, a default Triple() could be passed in.

Definition at line 552 of file CommandFlags.cpp.

References llvm::FloatABI::Default, getAlignLoops(), getBBSectionsMode(), getDebuggerTuningOpt(), getDebugStrictDwarf(), getDenormalFPMath(), getDisableIntegratedAS(), getDontPlaceZerosInBSS(), getEABIVersion(), getEmitCallSiteInfo(), getEnableAddrsig(), getEnableAIXExtendedAltivecABI(), getEnableBBAddrMap(), getEnableCallGraphSection(), getEnableDebugEntryValues(), getEnableGuaranteedTailCallOpt(), getEnableHonorSignDependentRoundingFPMath(), getEnableMachineFunctionSplitter(), getEnableNoInfsFPMath(), getEnableNoNaNsFPMath(), getEnableNoSignedZerosFPMath(), getEnableNoTrappingFPMath(), getEnableStackSizeSection(), getEnableStaticDataPartitioning(), getEnableUnsafeFPMath(), getExceptionModel(), getExplicitDataSections(), getExplicitEmulatedTLS(), getExplicitEnableTLSDESC(), getFloatABIForCalls(), getForceDwarfFrameSection(), getFunctionSections(), getFuseFPOps(), getIgnoreXCOFFVisibility(), getJMCInstrument(), getSeparateNamedSections(), getStackSymbolOrdering(), getSwiftAsyncFramePointer(), getThreadModel(), getTLSSize(), getUniqueBasicBlockSectionNames(), getUniqueSectionNames(), getUseCtors(), getXCOFFReadOnlyPointers(), getXCOFFTracebackTable(), getXRayFunctionIndex(), llvm::Triple::hasDefaultDataSections(), llvm::Triple::hasDefaultEmulatedTLS(), llvm::Triple::hasDefaultTLSDESC(), llvm::mc::InitMCTargetOptionsFromFlags(), and Options.

Referenced by createTargetMachineForTriple().

◆ renderBoolStringAttr()

void llvm::codegen::renderBoolStringAttr ( AttrBuilder B,
StringRef  Name,
bool  Val 
)

Definition at line 659 of file CommandFlags.cpp.

References B, and Name.

◆ setFunctionAttributes() [1/2]

void llvm::codegen::setFunctionAttributes ( StringRef  CPU,
StringRef  Features,
Function F 
)

◆ setFunctionAttributes() [2/2]

void llvm::codegen::setFunctionAttributes ( StringRef  CPU,
StringRef  Features,
Module M 
)

Set function attributes of functions in Module M based on CPU, Features, and command line flags.

Definition at line 749 of file CommandFlags.cpp.

References F, and setFunctionAttributes().