|
LLVM 24.0.0git
|
Classes | |
| struct | RegisterCodeGenFlags |
| Create this object with static storage to register codegen-related command line options. More... | |
| struct | RegisterMTuneFlag |
| Tools that support subtarget tuning should create this object with static storage to register the -mtune command line option. More... | |
| struct | RegisterSaveStatsFlag |
| Tools that support stats saving should create this object with static storage to register the –save-stats command line option. More... | |
Enumerations | |
| enum | SaveStatsMode { None , Cwd , Obj } |
| Enumerator | |
|---|---|
| None | |
| Cwd | |
| Obj | |
Definition at line 134 of file CommandFlags.h.
| Expected< std::unique_ptr< TargetMachine > > llvm::codegen::createTargetMachineForTriple | ( | const cl::LibraryOptionsContext & | LibraryOptions, |
| const Triple & | 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 743 of file CommandFlags.cpp.
References llvm::createStringError(), llvm::Target::createTargetMachine(), createTargetMachineForTriple(), getCPUStr(), getExplicitCodeModel(), getExplicitRelocModel(), getFeaturesStr(), getMArch(), getTargetOptions(), llvm::inconvertibleErrorCode(), llvm::TargetRegistry::lookupTarget(), Options, and llvm::Triple::str().
Referenced by createTargetMachineForTriple().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI std::string llvm::codegen::getBBSections | ( | ) |
References LLVM_ABI.
Referenced by getBBSectionsMode().
| llvm::BasicBlockSection llvm::codegen::getBBSectionsMode | ( | llvm::TargetOptions & | Options | ) |
Definition at line 489 of file CommandFlags.cpp.
References llvm::All, llvm::errs(), getBBSections(), getBBSectionsMode(), llvm::ErrorOr< T >::getError(), llvm::MemoryBuffer::getFile(), llvm::List, llvm::None, and Options.
Referenced by getBBSectionsMode(), and getTargetOptions().
| LLVM_ABI CodeModel::Model llvm::codegen::getCodeModel | ( | ) |
References LLVM_ABI.
| std::string llvm::codegen::getCPUStr | ( | ) |
Definition at line 552 of file CommandFlags.cpp.
References getCPUStr(), llvm::sys::getHostCPUName(), and getMCPU().
Referenced by createTargetMachineForTriple(), and getCPUStr().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI DenormalMode::DenormalModeKind llvm::codegen::getDenormalFP32Math | ( | ) |
References LLVM_ABI.
Referenced by setFunctionAttributes().
| LLVM_ABI DenormalMode::DenormalModeKind llvm::codegen::getDenormalFPMath | ( | ) |
References LLVM_ABI.
Referenced by setFunctionAttributes().
References LLVM_ABI.
Referenced by setFunctionAttributes().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References B(), llvm::Default, F, LLVM_ABI, Options, and OutputFilename.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI llvm::ExceptionHandling llvm::codegen::getExceptionModel | ( | ) |
References LLVM_ABI.
Referenced by setFunctionAttributes().
| LLVM_ABI std::optional< CodeModel::Model > llvm::codegen::getExplicitCodeModel | ( | ) |
References LLVM_ABI.
Referenced by createTargetMachineForTriple().
References LLVM_ABI.
Referenced by getTargetOptions(), and initTMBuilder().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI std::optional< CodeGenFileType > llvm::codegen::getExplicitFileType | ( | ) |
References LLVM_ABI.
References LLVM_ABI.
| LLVM_ABI std::optional< Reloc::Model > llvm::codegen::getExplicitRelocModel | ( | ) |
References LLVM_ABI.
Referenced by createTargetMachineForTriple().
| std::vector< std::string > llvm::codegen::getFeatureList | ( | ) |
Definition at line 593 of file CommandFlags.cpp.
References llvm::SubtargetFeatures::AddFeature(), getFeatureList(), llvm::SubtargetFeatures::getFeatures(), llvm::sys::getHostCPUFeatures(), getMAttrs(), and getMCPU().
Referenced by getFeatureList().
| std::string llvm::codegen::getFeaturesStr | ( | ) |
Definition at line 576 of file CommandFlags.cpp.
References llvm::SubtargetFeatures::AddFeature(), getFeaturesStr(), llvm::sys::getHostCPUFeatures(), getMAttrs(), getMCPU(), and llvm::SubtargetFeatures::getString().
Referenced by createTargetMachineForTriple(), and getFeaturesStr().
| LLVM_ABI CodeGenFileType llvm::codegen::getFileType | ( | ) |
References LLVM_ABI.
| LLVM_ABI llvm::FloatABI::ABIType llvm::codegen::getFloatABIForCalls | ( | ) |
References LLVM_ABI.
Referenced by setFunctionAttributes().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI FramePointerKind llvm::codegen::getFramePointerUsage | ( | ) |
References LLVM_ABI.
Referenced by setFunctionAttributes().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI std::string llvm::codegen::getMArch | ( | ) |
References LLVM_ABI.
Referenced by createTargetMachineForTriple().
| LLVM_ABI std::vector< std::string > llvm::codegen::getMAttrs | ( | ) |
References LLVM_ABI.
Referenced by getFeatureList(), and getFeaturesStr().
| LLVM_ABI std::string llvm::codegen::getMCPU | ( | ) |
References LLVM_ABI.
Referenced by getCPUStr(), getFeatureList(), and getFeaturesStr().
| LLVM_ABI std::string llvm::codegen::getMTune | ( | ) |
References LLVM_ABI.
Referenced by getTuneCPUStr().
| LLVM_ABI Reloc::Model llvm::codegen::getRelocModel | ( | ) |
References LLVM_ABI.
| LLVM_ABI SaveStatsMode llvm::codegen::getSaveStats | ( | ) |
References LLVM_ABI.
Referenced by MaybeEnableStatistics(), and MaybeSaveStatistics().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by setFunctionAttributes().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI SwiftAsyncFramePointerMode llvm::codegen::getSwiftAsyncFramePointer | ( | ) |
References LLVM_ABI.
Referenced by getTargetOptions().
| TargetOptions llvm::codegen::getTargetOptions | ( | const cl::LibraryOptionsContext & | LibraryOptions, |
| const llvm::Triple & | TheTriple ) |
Common utility function tightly tied to the options listed here.
Initializes a TargetOptions object with CodeGen options 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 510 of file CommandFlags.cpp.
References getAlignLoops(), getBBSectionsMode(), getDebugStrictDwarf(), getDontPlaceZerosInBSS(), getEmitCallSiteInfo(), getEnableAddrsig(), getEnableBBAddrMap(), getEnableCallGraphSection(), getEnableDebugEntryValues(), getEnableGuaranteedTailCallOpt(), getEnableStackSizeSection(), getEnableStaticDataPartitioning(), getExplicitDataSections(), getExplicitEmulatedTLS(), getExplicitEnableTLSDESC(), getForceDwarfFrameSection(), getFunctionSections(), getIgnoreXCOFFVisibility(), getJMCInstrument(), llvm::mc::getMCTargetOptions(), getSeparateNamedSections(), getStackSymbolOrdering(), getSwiftAsyncFramePointer(), getTargetOptions(), getTLSSize(), getUniqueBasicBlockSectionNames(), getUniqueSectionNames(), getUseCtors(), getVectorLibrary(), getXCOFFReadOnlyPointers(), getXCOFFTracebackTable(), getXRayFunctionIndex(), llvm::Triple::hasDefaultDataSections(), llvm::Triple::hasDefaultEmulatedTLS(), llvm::Triple::hasDefaultTLSDESC(), and Options.
Referenced by createTargetMachineForTriple(), and getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI std::string llvm::codegen::getTrapFuncName | ( | ) |
References LLVM_ABI.
Referenced by setFunctionAttributes().
| std::string llvm::codegen::getTuneCPUStr | ( | ) |
Definition at line 564 of file CommandFlags.cpp.
References llvm::sys::getHostCPUName(), getMTune(), and getTuneCPUStr().
Referenced by getTuneCPUStr().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
| LLVM_ABI llvm::VectorLibrary llvm::codegen::getVectorLibrary | ( | ) |
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
References LLVM_ABI.
Referenced by getTargetOptions().
| void llvm::codegen::MaybeEnableStatistics | ( | ) |
Conditionally enables the collection of LLVM statistics during the tool run, based on the value of the flag.
Must be called before the tool run to actually collect data.
Definition at line 766 of file CommandFlags.cpp.
References llvm::EnableStatistics(), getSaveStats(), MaybeEnableStatistics(), and None.
Referenced by MaybeEnableStatistics().
Conditionally saves the collected LLVM statistics to the received output file, based on the value of the flag.
Should be called after the tool run, and must follow a call to MaybeEnableStatistics() to actually have data to write.
Definition at line 773 of file CommandFlags.cpp.
References llvm::sys::path::append(), assert(), Cwd, llvm::WithColor::error(), llvm::errs(), llvm::sys::path::filename(), getSaveStats(), MaybeSaveStatistics(), None, Obj, llvm::sys::fs::OF_TextWithCRLF, OutputFilename, llvm::PrintStatisticsJSON(), llvm::sys::path::remove_filename(), and llvm::sys::path::replace_extension().
Referenced by MaybeSaveStatistics().
Definition at line 610 of file CommandFlags.cpp.
References B(), and renderBoolStringAttr().
Referenced by renderBoolStringAttr().
| void llvm::codegen::setFunctionAttributes | ( | Function & | F, |
| StringRef | CPU, | ||
| StringRef | Features, | ||
| StringRef | TuneCPU = "" ) |
Set function attributes of function F based on CPU, TuneCPU, Features, and command line flags.
Definition at line 620 of file CommandFlags.cpp.
References llvm::All, llvm::SmallString< InternalLen >::append(), B(), Call, llvm::dyn_cast(), llvm::StringRef::empty(), F, llvm::Attribute::get(), getDenormalFP32Math(), getDenormalFPMath(), getDisableTailCalls(), getFramePointerUsage(), getStackRealign(), getTrapFuncName(), I, llvm::None, llvm::NonLeaf, llvm::NonLeafNoReserve, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Reserved, setFunctionAttributes(), and llvm::toStringRef().
Referenced by setFunctionAttributes(), and setFunctionAttributes().
| void llvm::codegen::setFunctionAttributes | ( | Module & | M, |
| StringRef | CPU, | ||
| StringRef | Features, | ||
| StringRef | TuneCPU = "" ) |
Set function attributes of functions in Module M based on CPU, TuneCPU, Features, and command line flags.
Definition at line 688 of file CommandFlags.cpp.
References llvm::Default, llvm::FloatABI::Default, llvm::dyn_cast_or_null(), llvm::StringRef::empty(), llvm::Module::Error, F, llvm::MDString::get(), llvm::mc::getABIName(), llvm::FloatABI::getABITypeName(), getExceptionModel(), llvm::getExceptionModelName(), getFloatABIForCalls(), llvm::reportFatalUsageError(), and setFunctionAttributes().