|
LLVM 24.0.0git
|
Enumerations | |
| enum | SaveStatsMode { None , Cwd , Obj } |
| Enumerator | |
|---|---|
| None | |
| Cwd | |
| Obj | |
Definition at line 74 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 384 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().
| std::string llvm::codegen::getCPUStr | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 196 of file CommandFlags.cpp.
References C(), getCPUStr(), llvm::sys::getHostCPUName(), and getMCPU().
Referenced by createTargetMachineForTriple(), and getCPUStr().
| std::optional< CodeModel::Model > llvm::codegen::getExplicitCodeModel | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 75 of file CommandFlags.cpp.
References C(), and getExplicitCodeModel().
Referenced by createTargetMachineForTriple(), and getExplicitCodeModel().
| std::optional< bool > llvm::codegen::getExplicitDataSections | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 99 of file CommandFlags.cpp.
References C(), getExplicitDataSections(), and llvm::toOptional().
Referenced by getExplicitDataSections(), and initTMBuilder().
| std::optional< bool > llvm::codegen::getExplicitEmulatedTLS | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 109 of file CommandFlags.cpp.
References C(), getExplicitEmulatedTLS(), and llvm::toOptional().
Referenced by getExplicitEmulatedTLS().
| std::optional< CodeGenFileType > llvm::codegen::getExplicitFileType | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 85 of file CommandFlags.cpp.
References C(), and getExplicitFileType().
Referenced by getExplicitFileType(), and getFileType().
| std::optional< bool > llvm::codegen::getExplicitFunctionSections | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 104 of file CommandFlags.cpp.
References C(), getExplicitFunctionSections(), and llvm::toOptional().
Referenced by getExplicitFunctionSections().
| std::optional< uint64_t > llvm::codegen::getExplicitLargeDataThreshold | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 80 of file CommandFlags.cpp.
References C(), and getExplicitLargeDataThreshold().
Referenced by getExplicitLargeDataThreshold().
| std::optional< Reloc::Model > llvm::codegen::getExplicitRelocModel | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 70 of file CommandFlags.cpp.
References C(), and getExplicitRelocModel().
Referenced by createTargetMachineForTriple(), and getExplicitRelocModel().
| std::vector< std::string > llvm::codegen::getFeatureList | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 238 of file CommandFlags.cpp.
References llvm::SubtargetFeatures::AddFeature(), C(), getFeatureList(), llvm::SubtargetFeatures::getFeatures(), llvm::sys::getHostCPUFeatures(), getMAttrs(), and getMCPU().
Referenced by getFeatureList().
| std::string llvm::codegen::getFeaturesStr | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 220 of file CommandFlags.cpp.
References llvm::SubtargetFeatures::AddFeature(), C(), getFeaturesStr(), llvm::sys::getHostCPUFeatures(), getMAttrs(), getMCPU(), and llvm::SubtargetFeatures::getString().
Referenced by createTargetMachineForTriple(), and getFeaturesStr().
| CodeGenFileType llvm::codegen::getFileType | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 89 of file CommandFlags.cpp.
References llvm::AssemblyFile, C(), getExplicitFileType(), and getFileType().
Referenced by getFileType().
| FloatABI::ABIType llvm::codegen::getFloatABIForCalls | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 94 of file CommandFlags.cpp.
References C(), and getFloatABIForCalls().
Referenced by getFloatABIForCalls(), and setFunctionAttributes().
| std::string llvm::codegen::getMArch | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 55 of file CommandFlags.cpp.
References C(), and getMArch().
Referenced by createTargetMachineForTriple(), and getMArch().
| std::vector< std::string > llvm::codegen::getMAttrs | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 64 of file CommandFlags.cpp.
References llvm::ArrayRef< T >::begin(), C(), llvm::ArrayRef< T >::end(), and getMAttrs().
Referenced by getFeatureList(), getFeaturesStr(), and getMAttrs().
| std::string llvm::codegen::getMCPU | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 59 of file CommandFlags.cpp.
References C(), and getMCPU().
Referenced by getCPUStr(), getFeatureList(), getFeaturesStr(), and getMCPU().
| std::string llvm::codegen::getMTune | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 113 of file CommandFlags.cpp.
References C(), and getMTune().
Referenced by getMTune(), and getTuneCPUStr().
| codegen::SaveStatsMode llvm::codegen::getSaveStats | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 118 of file CommandFlags.cpp.
References C(), and getSaveStats().
Referenced by getSaveStats(), maybeEnableStatistics(), and maybeSaveStatistics().
| 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 153 of file CommandFlags.cpp.
References llvm::cl::LibraryOptionsContext::get(), getBBSectionsMode(), llvm::mc::getMCTargetOptions(), getTargetOptions(), llvm::Triple::hasDefaultDataSections(), llvm::Triple::hasDefaultEmulatedTLS(), llvm::Triple::hasDefaultTLSDESC(), Options, and llvm::valueOr().
Referenced by createTargetMachineForTriple(), and getTargetOptions().
| ArrayRef< const cl::LibraryOptions * > llvm::codegen::getToolOptions | ( | ) |
The options that a tool reading getTargetOptions passes to cl::parseCommandLineOptions.
Definition at line 122 of file CommandFlags.cpp.
References assert(), getToolOptions(), llvm::mc::getToolOptions(), and llvm::size().
Referenced by getToolOptions(), and llvm::LTOCodeGenerator::parseCodeGenDebugOptions().
| std::string llvm::codegen::getTuneCPUStr | ( | const cl::LibraryOptionsContext & | C | ) |
Definition at line 208 of file CommandFlags.cpp.
References C(), llvm::sys::getHostCPUName(), getMTune(), and getTuneCPUStr().
Referenced by getTuneCPUStr().
| void llvm::codegen::maybeEnableStatistics | ( | const cl::LibraryOptionsContext & | C | ) |
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 407 of file CommandFlags.cpp.
References C(), llvm::EnableStatistics(), getSaveStats(), maybeEnableStatistics(), and None.
Referenced by maybeEnableStatistics().
| int llvm::codegen::maybeSaveStatistics | ( | const cl::LibraryOptionsContext & | C, |
| StringRef | OutputFilename, | ||
| StringRef | ToolName ) |
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 414 of file CommandFlags.cpp.
References llvm::sys::path::append(), assert(), C(), 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 255 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 259 of file CommandFlags.cpp.
References llvm::All, llvm::SmallString< InternalLen >::append(), B(), Call, llvm::Default, llvm::dyn_cast(), llvm::StringRef::empty(), F, llvm::Attribute::get(), getCodeGenToolOptions(), I, llvm::DenormalMode::IEEE, llvm::DenormalMode::Invalid, llvm::None, llvm::NonLeaf, llvm::NonLeafNoReserve, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Reserved, setFunctionAttributes(), llvm::toStringRef(), and llvm::valueOr().
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 328 of file CommandFlags.cpp.
References C(), 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(), getCodeGenToolOptions(), llvm::getExceptionModelName(), getFloatABIForCalls(), llvm::reportFatalUsageError(), and setFunctionAttributes().