|
LLVM
3.7.0
|
A switch()-like statement whose cases are string literals. More...
#include <StringSwitch.h>
Public Member Functions | |
| StringSwitch (StringRef S) | |
| template<unsigned N> | |
| StringSwitch & | Case (const char(&S)[N], const T &Value) |
| template<unsigned N> | |
| StringSwitch & | EndsWith (const char(&S)[N], const T &Value) |
| template<unsigned N> | |
| StringSwitch & | StartsWith (const char(&S)[N], const T &Value) |
| template<unsigned N0, unsigned N1> | |
| StringSwitch & | Cases (const char(&S0)[N0], const char(&S1)[N1], const T &Value) |
| template<unsigned N0, unsigned N1, unsigned N2> | |
| StringSwitch & | Cases (const char(&S0)[N0], const char(&S1)[N1], const char(&S2)[N2], const T &Value) |
| template<unsigned N0, unsigned N1, unsigned N2, unsigned N3> | |
| StringSwitch & | Cases (const char(&S0)[N0], const char(&S1)[N1], const char(&S2)[N2], const char(&S3)[N3], const T &Value) |
| template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4> | |
| StringSwitch & | Cases (const char(&S0)[N0], const char(&S1)[N1], const char(&S2)[N2], const char(&S3)[N3], const char(&S4)[N4], const T &Value) |
| R | Default (const T &Value) const |
| operator R () const | |
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 42 of file StringSwitch.h.
|
inlineexplicit |
Definition at line 51 of file StringSwitch.h.
|
inline |
Definition at line 55 of file StringSwitch.h.
References llvm::StringRef::data(), and llvm::StringRef::size().
Referenced by llvm::AArch64StringToVectorLayout(), llvm::StringSwitch< T, R >::Cases(), llvm::classifyEHPersonality(), llvm::DWARFContextInMemory::DWARFContextInMemory(), llvm::Triple::getArchTypeForLLVMName(), getBankedRegisterMask(), llvm::objcarc::GetFunctionClass(), getIdentifierKind(), getMClassFlagsMask(), getMClassRegisterSYSmValueMask(), getRegForName(), llvm::PPCTargetLowering::getRegisterByName(), llvm::X86TargetLowering::getRegisterByName(), llvm::object::MachOObjectFile::isValidArch(), MCAttrForString(), parseArch(), llvm::SparcMCExpr::parseVariantKind(), and parseVendor().
|
inline |
Definition at line 85 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case().
Referenced by llvm::createARMAsmBackend(), getIntelMemOperandSize(), MCAttrForString(), and parseArch().
|
inline |
Definition at line 91 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case().
|
inline |
Definition at line 97 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case().
|
inline |
Definition at line 104 of file StringSwitch.h.
References llvm::StringSwitch< T, R >::Case().
|
inline |
Definition at line 111 of file StringSwitch.h.
Referenced by llvm::AArch64StringToVectorLayout(), llvm::classifyEHPersonality(), llvm::createARMAsmBackend(), llvm::createX86_64AsmBackend(), llvm::DWARFContextInMemory::DWARFContextInMemory(), llvm::Triple::getArchTypeForLLVMName(), getBankedRegisterMask(), llvm::objcarc::GetFunctionClass(), getIdentifierKind(), getIntelMemOperandSize(), getMClassFlagsMask(), getMClassRegisterSYSmValueMask(), getRegForName(), llvm::MipsTargetLowering::getRegisterByName(), llvm::PPCTargetLowering::getRegisterByName(), llvm::X86TargetLowering::getRegisterByName(), llvm::object::MachOObjectFile::isValidArch(), MCAttrForString(), parseArch(), llvm::ARMTargetParser::parseArchISA(), parseEnvironment(), parseFormat(), parseOS(), parseSubArch(), llvm::SparcMCExpr::parseVariantKind(), and parseVendor().
|
inline |
Definition at line 65 of file StringSwitch.h.
References llvm::StringRef::data(), N, and llvm::StringRef::size().
Referenced by parseFormat(), and parseSubArch().
|
inline |
Definition at line 118 of file StringSwitch.h.
|
inline |
Definition at line 75 of file StringSwitch.h.
References llvm::StringRef::data(), and llvm::StringRef::size().
Referenced by llvm::Triple::getArchTypeForLLVMName(), parseArch(), llvm::ARMTargetParser::parseArchISA(), parseEnvironment(), and parseOS().
1.8.6