LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::SubtargetFeatures Class Reference

#include <SubtargetFeature.h>

Public Member Functions

 SubtargetFeatures (const StringRef Initial="")
 
std::string getString () const
 Features string accessors. More...
 
void AddFeature (const StringRef String, bool IsEnabled=true)
 Adding Features. More...
 
uint64_t ToggleFeature (uint64_t Bits, const StringRef String, const SubtargetFeatureKV *FeatureTable, size_t FeatureTableSize)
 
uint64_t getFeatureBits (const StringRef CPU, const SubtargetFeatureKV *CPUTable, size_t CPUTableSize, const SubtargetFeatureKV *FeatureTable, size_t FeatureTableSize)
 Get feature bits of a CPU. More...
 
void print (raw_ostream &OS) const
 Print feature string. More...
 
void dump () const
 
void getDefaultSubtargetFeatures (const Triple &Triple)
 Adds the default features for the specified target triple. More...
 

Detailed Description

SubtargetFeatures - 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 72 of file SubtargetFeature.h.

Constructor & Destructor Documentation

SubtargetFeatures::SubtargetFeatures ( const StringRef  Initial = "")
explicit

Definition at line 175 of file SubtargetFeature.cpp.

References Split().

Member Function Documentation

void SubtargetFeatures::AddFeature ( const StringRef  String,
bool  IsEnabled = true 
)

Adding Features.

Adding features.

Definition at line 112 of file SubtargetFeature.cpp.

References llvm::StringRef::empty(), llvm::StringRef::lower(), and PrependFlag().

Referenced by getDefaultSubtargetFeatures(), and llvm::EngineBuilder::selectTarget().

void SubtargetFeatures::dump ( ) const

dump - Dump feature info.

Definition at line 348 of file SubtargetFeature.cpp.

References llvm::dbgs(), and print().

void SubtargetFeatures::getDefaultSubtargetFeatures ( const Triple Triple)

Adds the default features for the specified target triple.

Adds the default features for the specified target triple.

FIXME: This is an inelegant way of specifying the features of a subtarget. It would be better if we could encode this information into the IR. See <rdar://5972456>.

Definition at line 359 of file SubtargetFeature.cpp.

References AddFeature(), llvm::Triple::Apple, llvm::Triple::getArch(), llvm::Triple::getVendor(), llvm::Triple::ppc, and llvm::Triple::ppc64.

uint64_t SubtargetFeatures::getFeatureBits ( const StringRef  CPU,
const SubtargetFeatureKV CPUTable,
size_t  CPUTableSize,
const SubtargetFeatureKV FeatureTable,
size_t  FeatureTableSize 
)
std::string SubtargetFeatures::getString ( ) const

Features string accessors.

Definition at line 181 of file SubtargetFeature.cpp.

References Join().

Referenced by llvm::EngineBuilder::selectTarget().

void SubtargetFeatures::print ( raw_ostream OS) const

Print feature string.

print - Print feature string.

Definition at line 339 of file SubtargetFeature.cpp.

Referenced by dump().

uint64_t SubtargetFeatures::ToggleFeature ( uint64_t  Bits,
const StringRef  Feature,
const SubtargetFeatureKV FeatureTable,
size_t  FeatureTableSize 
)

ToggleFeature - Toggle a feature and returns the newly updated feature bits.

Definition at line 226 of file SubtargetFeature.cpp.

References llvm::tgtok::Bits, ClearImpliedBits(), llvm::errs(), Find(), SetImpliedBits(), StripFlag(), and llvm::SubtargetFeatureKV::Value.

Referenced by llvm::MCSubtargetInfo::ToggleFeature().


The documentation for this class was generated from the following files: