LLVM API Documentation

Public Member Functions
llvm::SubtargetFeatures Class Reference

#include <SubtargetFeature.h>

List of all members.

Public Member Functions

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

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 ( StringRef  Initial = "") [explicit]

Definition at line 139 of file SubtargetFeature.cpp.

References Split().


Member Function Documentation

Adding Features.

Adding features.

Definition at line 84 of file SubtargetFeature.cpp.

References llvm::StringRef::empty(), hasFlag(), llvm::StringRef::lower(), and llvm::StringRef::str().

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

void SubtargetFeatures::dump ( ) const

dump - Dump feature info.

Definition at line 304 of file SubtargetFeature.cpp.

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

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 315 of file SubtargetFeature.cpp.

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

std::string SubtargetFeatures::getString ( ) const

Features string accessors.

Definition at line 145 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 295 of file SubtargetFeature.cpp.

References F().

Referenced by dump().

uint64_t SubtargetFeatures::ToggleFeature ( uint64_t  Bits,
StringRef  Feature,
ArrayRef< SubtargetFeatureKV FeatureTable 
)

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

Definition at line 184 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: