|
LLVM
10.0.0
|
Manages the enabling and disabling of subtarget specific features. More...
#include "llvm/MC/SubtargetFeature.h"
Public Member Functions | |
| SubtargetFeatures (StringRef Initial="") | |
| std::string | getString () const |
| Returns features as a string. More... | |
| void | AddFeature (StringRef String, bool Enable=true) |
| Adds Features. More... | |
| const std::vector< std::string > & | getFeatures () const |
| Returns the vector of individual subtarget features. More... | |
| void | print (raw_ostream &OS) const |
| Prints feature string. More... | |
| void | dump () const |
| void | getDefaultSubtargetFeatures (const Triple &Triple) |
| Adds the default features for the specified target triple. More... | |
Static Public Member Functions | |
| static bool | hasFlag (StringRef Feature) |
| Determine if a feature has a flag; '+' or '-'. More... | |
| static std::string | StripFlag (StringRef Feature) |
| Return string stripped of flag. More... | |
| static bool | isEnabled (StringRef Feature) |
| Return true if enable flag; '+'. More... | |
| static void | Split (std::vector< std::string > &V, StringRef S) |
| Splits a string of comma separated items in to a vector of strings. More... | |
Manages the enabling and disabling of subtarget specific features.
Features are encoded as a string of the form "+attr1,+attr2,-attr3,...,+attrN" A comma separates each feature from the next (all lowercase.) Each of the remaining features is prefixed with + or - indicating whether that feature should be enabled or disabled contrary to the cpu specification.
Definition at line 183 of file SubtargetFeature.h.
|
explicit |
Definition at line 47 of file SubtargetFeature.cpp.
References Split().
Adds Features.
Definition at line 39 of file SubtargetFeature.cpp.
References llvm::StringRef::empty(), hasFlag(), and llvm::StringRef::lower().
Referenced by llvm::orc::JITTargetMachineBuilder::addFeatures(), llvm::lto::Config::addSaveTemps(), llvm::orc::JITTargetMachineBuilder::detectHost(), llvm::object::ELFObjectFileBase::getARMFeatures(), getDefaultSubtargetFeatures(), llvm::object::ELFObjectFileBase::getMIPSFeatures(), llvm::object::ELFObjectFileBase::getRISCVFeatures(), LLVMGetHostCPUFeatures(), and llvm::EngineBuilder::selectTarget().
| LLVM_DUMP_METHOD void SubtargetFeatures::dump | ( | ) | const |
Definition at line 63 of file SubtargetFeature.cpp.
References llvm::dbgs(), and print().
Adds the default features for the specified target triple.
Definition at line 68 of file SubtargetFeature.cpp.
References AddFeature(), llvm::Triple::Apple, llvm::Triple::getArch(), llvm::Triple::getVendor(), llvm::Triple::ppc, and llvm::Triple::ppc64.
Referenced by llvm::lto::Config::addSaveTemps(), llvm::LTOCodeGenerator::compile(), llvm::TargetMachineBuilder::create(), and parseBitcodeFileImpl().
|
inline |
Returns the vector of individual subtarget features.
Definition at line 196 of file SubtargetFeature.h.
References llvm::dump(), and print().
Referenced by llvm::MCSubtargetInfo::checkFeatures(), and getFeatures().
| std::string SubtargetFeatures::getString | ( | ) | const |
Returns features as a string.
Definition at line 52 of file SubtargetFeature.cpp.
References llvm::join().
Referenced by llvm::lto::Config::addSaveTemps(), llvm::LTOCodeGenerator::compile(), llvm::TargetMachineBuilder::create(), llvm::orc::JITTargetMachineBuilder::createTargetMachine(), LLVMGetHostCPUFeatures(), parseBitcodeFileImpl(), and llvm::EngineBuilder::selectTarget().
Determine if a feature has a flag; '+' or '-'.
Definition at line 208 of file SubtargetFeature.h.
References assert(), and llvm::StringRef::empty().
Referenced by AddFeature(), and ApplyFeatureFlag().
Return true if enable flag; '+'.
Definition at line 222 of file SubtargetFeature.h.
References assert(), and llvm::StringRef::empty().
Referenced by ApplyFeatureFlag().
| void SubtargetFeatures::print | ( | raw_ostream & | OS | ) | const |
Prints feature string.
Definition at line 56 of file SubtargetFeature.cpp.
References F().
Referenced by dump().
|
static |
Splits a string of comma separated items in to a vector of strings.
Definition at line 33 of file SubtargetFeature.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), and llvm::StringRef::split().
Referenced by SubtargetFeatures().
|
inlinestatic |
Return string stripped of flag.
Definition at line 217 of file SubtargetFeature.h.
References llvm::StringRef::substr().
Referenced by ApplyFeatureFlag(), and llvm::MCSubtargetInfo::ToggleFeature().
1.8.13