LLVM 20.0.0git
|
A switch()-like statement whose cases are string literals. More...
#include "llvm/ADT/StringSwitch.h"
A switch()-like statement whose cases are string literals.
The StringSwitch class is a simple form of a switch() statement that determines whether the given string matches one of the given string literals. The template type parameter T
is the type of the value that will be returned from the string-switch expression. For example, the following code switches on the name of a color in argv
[i]:
Definition at line 44 of file StringSwitch.h.
|
inlineexplicit |
Definition at line 53 of file StringSwitch.h.
|
delete |
|
inline |
Definition at line 63 of file StringSwitch.h.
|
default |
|
inline |
Definition at line 69 of file StringSwitch.h.
Referenced by llvm::AArch64StringToVectorLayout(), llvm::ARMCondCodeFromString(), llvm::ARMVectorCondCodeFromString(), llvm::StringSwitch< T, R >::Cases(), llvm::classifyEHPersonality(), llvm::ELF::convertArchNameToEMachine(), llvm::convertStrToExceptionBehavior(), llvm::convertStrToRoundingMode(), llvm::TargetOptions::FramePointerIsReserved(), llvm::ARM::getArchSynonym(), llvm::Triple::getArchTypeForLLVMName(), llvm::DIFile::getChecksumKind(), llvm::Hexagon::getCpu(), llvm::Hexagon_MC::GetELFFlags(), llvm::DICompileUnit::getEmissionKind(), llvm::ARMAsmBackendELF::getFixupKind(), llvm::AVRAsmBackend::getFixupKind(), llvm::LoongArchAsmBackend::getFixupKind(), llvm::MipsAsmBackend::getFixupKind(), llvm::RISCVAsmBackend::getFixupKind(), getFPPredicateFromMD(), llvm::ARM::getFPUSynonym(), llvm::sys::detail::getHostCPUNameForARM(), llvm::sys::detail::getHostCPUNameForPowerPC(), llvm::sys::detail::getHostCPUNameForRISCV(), getHWDivSynonym(), getIdentifierKind(), llvm::object::getImageKind(), llvm::M68kTargetLowering::getInlineAsmMemConstraint(), getIntPredicateFromMD(), llvm::mca::RISCVLMULInstrument::getLMUL(), llvm::getMachineType(), llvm::dwarf::getMacinfo(), getMClassFlagsMask(), getMetadataKeywordKind(), llvm::DICompileUnit::getNameTableKind(), llvm::object::getOffloadKind(), llvm::dwarf::getOperationEncoding(), llvm::MachO::getPlatformFromName(), llvm::RISCVTargetLowering::getRegForInlineAsmConstraint(), llvm::SITargetLowering::getRegisterByName(), llvm::AVRTargetLowering::getRegisterByName(), llvm::HexagonTargetLowering::getRegisterByName(), llvm::LanaiTargetLowering::getRegisterByName(), llvm::MipsTargetLowering::getRegisterByName(), llvm::PPCTargetLowering::getRegisterByName(), llvm::SparcTargetLowering::getRegisterByName(), llvm::SystemZTargetLowering::getRegisterByName(), llvm::VETargetLowering::getRegisterByName(), llvm::X86TargetLowering::getRegisterByName(), llvm::mca::RISCVSEWInstrument::getSEW(), llvm::pdb::PDBSymbolCompiland::getSourceFileFullPath(), getSpecialRegForName(), llvm::LoongArchABI::getTargetABI(), llvm::RISCVABI::getTargetABI(), llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::getValueKind(), llvm::MCSymbolRefExpr::getVariantKindForName(), llvm::LoongArchMCExpr::getVariantKindForName(), llvm::RISCVMCExpr::getVariantKindForName(), llvm::VFABI::getVFParamKindFromString(), llvm::yaml::ScalarTraits< IFSBitWidthType >::input(), llvm::yaml::ScalarTraits< IFSEndiannessType >::input(), llvm::yaml::ScalarTraits< SwiftVersion >::input(), isSMEABIRoutineCall(), isSpecialLLVMGlobalArrayToSkip(), llvm::object::Lexer::lex(), llvm::object::COFFObjectFile::mapDebugSectionName(), llvm::object::MachOObjectFile::mapDebugSectionName(), llvm::object::XCOFFObjectFile::mapDebugSectionName(), matchMatrixRegName(), matchMatrixTileListRegName(), MatchNeonVectorRegName(), matchSVEDataVectorRegName(), matchSVEPredicateAsCounterRegName(), matchSVEPredicateVectorRegName(), MCAttrForString(), llvm::PPC::normalizeCPUName(), llvm::HexagonMCInstrInfo::packetSize(), parseAMDGPUAtomicOptimizerStrategy(), parseArch(), llvm::WebAssembly::parseBlockType(), parseConstraintCode(), llvm::parseDenormalFPAttributeComponent(), llvm::MachO::TextAPIWriter::parseFileType(), llvm::remarks::parseFormat(), llvm::WebAssembly::parseMVT(), parseNamePrefix(), parseOptLevel(), parsePredicateConstraint(), parseReducedGprConstraint(), llvm::remarks::YAMLRemarkParser::parseType(), llvm::SparcMCExpr::parseVariantKind(), llvm::VEMCExpr::parseVariantKind(), parseVendor(), llvm::SymbolRemappingReader::read(), shouldUpgradeNVPTXBF16Intrinsic(), llvm::LPAC::stringToLanaiAluCode(), llvm::RISCVFPRndMode::stringToRoundingMode(), llvm::stringToVEFCondCode(), llvm::stringToVEICondCode(), llvm::stringToVERD(), upgradeArmOrAarch64IntrinsicFunction(), upgradeIntrinsicFunction1(), and upgradeX86IntrinsicFunction().
|
inline |
Definition at line 142 of file StringSwitch.h.
Referenced by llvm::StringSwitch< T, R >::CasesLower().
|
inline |
Definition at line 134 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), S1, and S8.
|
inline |
Definition at line 127 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), S1, and S8.
|
inline |
Definition at line 121 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), and S1.
|
inline |
Definition at line 115 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), and S1.
|
inline |
Definition at line 109 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), and S1.
|
inline |
Definition at line 104 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), and S1.
|
inline |
Definition at line 99 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), and S1.
|
inline |
Definition at line 94 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), and S1.
|
inline |
Definition at line 90 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case(), and S1.
Referenced by llvm::StringSwitch< T, R >::Cases(), llvm::TargetOptions::FramePointerIsReserved(), llvm::ARM::getArchSynonym(), llvm::ARM::getFPUSynonym(), llvm::getMachineType(), llvm::RISCVTargetLowering::getRegForInlineAsmConstraint(), llvm::mca::RISCVLMULInstrument::isDataValid(), llvm::mca::RISCVSEWInstrument::isDataValid(), isSpecialLLVMGlobalArrayForStaticInit(), isValidInsnFormat(), MCAttrForString(), llvm::PPC::normalizeCPUName(), parseAMDGPUAtomicOptimizerStrategy(), parseArch(), llvm::parseDenormalFPAttributeComponent(), llvm::remarks::parseFormat(), llvm::Triple::Triple(), upgradeArmOrAarch64IntrinsicFunction(), and upgradeIntrinsicFunction1().
|
inline |
Definition at line 177 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::CaseLower(), llvm::StringSwitch< T, R >::CasesLower(), and S1.
|
inline |
Definition at line 172 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::CaseLower(), llvm::StringSwitch< T, R >::CasesLower(), and S1.
|
inline |
Definition at line 167 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::CaseLower(), llvm::StringSwitch< T, R >::CasesLower(), and S1.
|
inline |
Definition at line 163 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::CaseLower(), and S1.
Referenced by llvm::StringSwitch< T, R >::CasesLower().
|
inline |
Definition at line 182 of file StringSwitch.h.
Referenced by llvm::AArch64StringToVectorLayout(), llvm::ARMCondCodeFromString(), llvm::ARMVectorCondCodeFromString(), llvm::classifyEHPersonality(), llvm::ELF::convertArchNameToEMachine(), llvm::ELF::convertNameToOSABI(), llvm::convertStrToExceptionBehavior(), llvm::convertStrToRoundingMode(), llvm::MachO::Target::create(), llvm::MachO::getArchitectureFromName(), llvm::ARM::getArchSynonym(), llvm::Triple::getArchTypeForLLVMName(), llvm::dwarf::getAttributeEncoding(), llvm::Attribute::getAttrKindFromName(), llvm::dwarf::getCallingConvention(), llvm::DIFile::getChecksumKind(), llvm::Hexagon::getCpu(), llvm::CSKY::getDefaultExtensions(), llvm::ARM::getDefaultExtensions(), llvm::ARM::getDefaultFPU(), llvm::DICompileUnit::getEmissionKind(), llvm::ARMAsmBackendELF::getFixupKind(), llvm::AVRAsmBackend::getFixupKind(), llvm::LoongArchAsmBackend::getFixupKind(), llvm::MipsAsmBackend::getFixupKind(), llvm::RISCVAsmBackend::getFixupKind(), llvm::DINode::getFlag(), llvm::DISubprogram::getFlag(), getFPPredicateFromMD(), llvm::ARM::getFPUSynonym(), llvm::sys::detail::getHostCPUNameForARM(), llvm::sys::detail::getHostCPUNameForPowerPC(), llvm::sys::detail::getHostCPUNameForRISCV(), getHWDivSynonym(), getIdentifierKind(), llvm::object::getImageKind(), llvm::M68kTargetLowering::getInlineAsmMemConstraint(), getIntPredicateFromMD(), llvm::dwarf::getLanguage(), getLlvmUserOperationEncoding(), llvm::getMachineType(), llvm::dwarf::getMacinfo(), llvm::dwarf::getMacro(), getMClassFlagsMask(), getMetadataKeywordKind(), llvm::DICompileUnit::getNameTableKind(), llvm::object::getOffloadKind(), llvm::omp::getOpenMPContextTraitPropertyForSelector(), llvm::omp::getOpenMPContextTraitSelectorKind(), llvm::omp::getOpenMPContextTraitSetKind(), llvm::dwarf::getOperationEncoding(), llvm::MachO::getPlatformFromName(), llvm::RISCVTargetLowering::getRegForInlineAsmConstraint(), llvm::SITargetLowering::getRegisterByName(), llvm::AVRTargetLowering::getRegisterByName(), llvm::HexagonTargetLowering::getRegisterByName(), llvm::LanaiTargetLowering::getRegisterByName(), llvm::MipsTargetLowering::getRegisterByName(), llvm::PPCTargetLowering::getRegisterByName(), llvm::SparcTargetLowering::getRegisterByName(), llvm::SystemZTargetLowering::getRegisterByName(), llvm::VETargetLowering::getRegisterByName(), llvm::X86TargetLowering::getRegisterByName(), llvm::pdb::PDBSymbolCompiland::getSourceFileFullPath(), getSpecialRegForName(), llvm::dwarf::getTag(), llvm::LoongArchABI::getTargetABI(), llvm::RISCVABI::getTargetABI(), llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::getValueKind(), llvm::MCSymbolRefExpr::getVariantKindForName(), llvm::LoongArchMCExpr::getVariantKindForName(), llvm::RISCVMCExpr::getVariantKindForName(), llvm::XtensaMCExpr::getVariantKindForName(), llvm::VFABI::getVFParamKindFromString(), llvm::dwarf::getVirtuality(), llvm::yaml::ScalarTraits< IFSBitWidthType >::input(), llvm::yaml::ScalarTraits< IFSEndiannessType >::input(), llvm::yaml::ScalarTraits< SwiftVersion >::input(), llvm::mca::RISCVLMULInstrument::isDataValid(), llvm::mca::RISCVSEWInstrument::isDataValid(), llvm::Attribute::isExistingAttribute(), isSMEABIRoutineCall(), isSpecialLLVMGlobalArrayForStaticInit(), isSpecialLLVMGlobalArrayToSkip(), isValidInsnFormat(), llvm::object::Lexer::lex(), llvm::remarks::magicToFormat(), llvm::object::COFFObjectFile::mapDebugSectionName(), llvm::object::MachOObjectFile::mapDebugSectionName(), llvm::object::XCOFFObjectFile::mapDebugSectionName(), llvm::object::MachOObjectFile::mapReflectionSectionNameToEnumValue(), matchMatrixRegName(), matchMatrixTileListRegName(), MatchNeonVectorRegName(), matchSVEDataVectorRegName(), matchSVEPredicateAsCounterRegName(), matchSVEPredicateVectorRegName(), MaybePredicatedInst(), MCAttrForString(), llvm::PPC::normalizeCPUName(), llvm::HexagonMCInstrInfo::packetSize(), parseAMDGPUAtomicOptimizerStrategy(), parseArch(), llvm::ARM::parseArchISA(), llvm::WebAssembly::parseBlockType(), parseConstraintCode(), llvm::parseDenormalFPAttributeComponent(), parseEnvironment(), llvm::MachO::TextAPIWriter::parseFileType(), parseFormat(), llvm::remarks::parseFormat(), llvm::WebAssembly::parseMVT(), parseNamePrefix(), parseOptLevel(), parseOS(), llvm::dxbc::parsePartType(), parsePredicateConstraint(), parseReducedGprConstraint(), parseSubArch(), parseThunkName(), llvm::remarks::YAMLRemarkParser::parseType(), llvm::SparcMCExpr::parseVariantKind(), llvm::VEMCExpr::parseVariantKind(), parseVendor(), llvm::SymbolRemappingReader::read(), shouldUpgradeNVPTXBF16Intrinsic(), SizeForSuffix(), llvm::LPAC::stringToLanaiAluCode(), llvm::RISCVFPRndMode::stringToRoundingMode(), llvm::stringToVEFCondCode(), llvm::stringToVEICondCode(), llvm::stringToVERD(), llvm::LPCC::suffixToLanaiCondCode(), llvm::Triple::Triple(), upgradeArmOrAarch64IntrinsicFunction(), llvm::UpgradeIntrinsicCall(), upgradeIntrinsicFunction1(), and upgradeX86IntrinsicFunction().
|
inline |
Definition at line 76 of file StringSwitch.h.
Referenced by llvm::generateKernelClockInst(), parseFormat(), parseSubArch(), SizeForSuffix(), and llvm::LPCC::suffixToLanaiCondCode().
|
inline |
Definition at line 149 of file StringSwitch.h.
|
inline |
Definition at line 188 of file StringSwitch.h.
References assert().
|
delete |
|
delete |
|
inline |
Definition at line 83 of file StringSwitch.h.
Referenced by llvm::ELF::convertNameToOSABI(), llvm::Triple::getArchTypeForLLVMName(), llvm::remarks::magicToFormat(), MaybePredicatedInst(), parseArch(), llvm::ARM::parseArchISA(), parseEnvironment(), parseOS(), parseThunkName(), llvm::Triple::Triple(), upgradeAMDGCNIntrinsicCall(), upgradeArmOrAarch64IntrinsicFunction(), llvm::UpgradeIntrinsicCall(), and upgradeIntrinsicFunction1().
|
inline |
Definition at line 156 of file StringSwitch.h.