LLVM  4.0.0
Functions
SubtargetFeature.cpp File Reference
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
Include dependency graph for SubtargetFeature.cpp:

Go to the source code of this file.

Functions

static bool hasFlag (StringRef Feature)
 hasFlag - Determine if a feature has a flag; '+' or '-' More...
 
static std::string StripFlag (StringRef Feature)
 StripFlag - Return string stripped of flag. More...
 
static bool isEnabled (StringRef Feature)
 isEnabled - Return true if enable flag; '+'. More...
 
static void Split (std::vector< std::string > &V, StringRef S)
 Split - Splits a string of comma separated items in to a vector of strings. More...
 
static const SubtargetFeatureKVFind (StringRef S, ArrayRef< SubtargetFeatureKV > A)
 Find KV in array using binary search. More...
 
static size_t getLongestEntryLength (ArrayRef< SubtargetFeatureKV > Table)
 getLongestEntryLength - Return the length of the longest entry in the table. More...
 
static void Help (ArrayRef< SubtargetFeatureKV > CPUTable, ArrayRef< SubtargetFeatureKV > FeatTable)
 Display help for feature choices. More...
 
static void SetImpliedBits (FeatureBitset &Bits, const SubtargetFeatureKV *FeatureEntry, ArrayRef< SubtargetFeatureKV > FeatureTable)
 SetImpliedBits - For each feature that is (transitively) implied by this feature, set it. More...
 
static void ClearImpliedBits (FeatureBitset &Bits, const SubtargetFeatureKV *FeatureEntry, ArrayRef< SubtargetFeatureKV > FeatureTable)
 ClearImpliedBits - For each feature that (transitively) implies this feature, clear it. More...
 

Function Documentation

static void ClearImpliedBits ( FeatureBitset Bits,
const SubtargetFeatureKV FeatureEntry,
ArrayRef< SubtargetFeatureKV FeatureTable 
)
static

ClearImpliedBits - For each feature that (transitively) implies this feature, clear it.

Definition at line 151 of file SubtargetFeature.cpp.

References llvm::SubtargetFeatureKV::Value.

Referenced by llvm::SubtargetFeatures::ApplyFeatureFlag(), and llvm::SubtargetFeatures::ToggleFeature().

static const SubtargetFeatureKV* Find ( StringRef  S,
ArrayRef< SubtargetFeatureKV A 
)
static
static size_t getLongestEntryLength ( ArrayRef< SubtargetFeatureKV Table)
static

getLongestEntryLength - Return the length of the longest entry in the table.

Definition at line 86 of file SubtargetFeature.cpp.

References I.

Referenced by Help().

static bool hasFlag ( StringRef  Feature)
inlinestatic

hasFlag - Determine if a feature has a flag; '+' or '-'

Definition at line 32 of file SubtargetFeature.cpp.

References assert(), and llvm::StringRef::empty().

Referenced by llvm::SubtargetFeatures::AddFeature(), llvm::SubtargetFeatures::ApplyFeatureFlag(), and StripFlag().

static void Help ( ArrayRef< SubtargetFeatureKV CPUTable,
ArrayRef< SubtargetFeatureKV FeatTable 
)
static

Display help for feature choices.

Definition at line 95 of file SubtargetFeature.cpp.

References llvm::errs(), llvm::format(), and getLongestEntryLength().

Referenced by llvm::SubtargetFeatures::getFeatureBits().

static bool isEnabled ( StringRef  Feature)
inlinestatic

isEnabled - Return true if enable flag; '+'.

Definition at line 48 of file SubtargetFeature.cpp.

References assert(), and llvm::StringRef::empty().

Referenced by llvm::SubtargetFeatures::ApplyFeatureFlag().

static void SetImpliedBits ( FeatureBitset Bits,
const SubtargetFeatureKV FeatureEntry,
ArrayRef< SubtargetFeatureKV FeatureTable 
)
static

SetImpliedBits - For each feature that is (transitively) implied by this feature, set it.

Definition at line 135 of file SubtargetFeature.cpp.

References llvm::SubtargetFeatureKV::Implies, and llvm::SubtargetFeatureKV::Value.

Referenced by llvm::SubtargetFeatures::ApplyFeatureFlag(), llvm::SubtargetFeatures::getFeatureBits(), and llvm::SubtargetFeatures::ToggleFeature().

static void Split ( std::vector< std::string > &  V,
StringRef  S 
)
static
static std::string StripFlag ( StringRef  Feature)
inlinestatic

StripFlag - Return string stripped of flag.

Definition at line 42 of file SubtargetFeature.cpp.

References hasFlag(), and llvm::StringRef::substr().

Referenced by llvm::SubtargetFeatures::ApplyFeatureFlag(), and llvm::SubtargetFeatures::ToggleFeature().