LLVM  8.0.1
Functions
SubtargetFeature.cpp File Reference
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <iterator>
#include <string>
#include <vector>
Include dependency graph for SubtargetFeature.cpp:

Go to the source code of this file.

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...
 
static const SubtargetFeatureKVFind (StringRef S, ArrayRef< SubtargetFeatureKV > A)
 Find KV in array using binary search. More...
 
static size_t getLongestEntryLength (ArrayRef< SubtargetFeatureKV > Table)
 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)
 For each feature that is (transitively) implied by this feature, set it. More...
 
static void ClearImpliedBits (FeatureBitset &Bits, const SubtargetFeatureKV &FeatureEntry, ArrayRef< SubtargetFeatureKV > FeatureTable)
 For each feature that (transitively) implies this feature, clear it. More...
 

Function Documentation

◆ ClearImpliedBits()

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

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

Definition at line 140 of file SubtargetFeature.cpp.

References llvm::SubtargetFeatureKV::Value.

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

◆ Find()

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

◆ getLongestEntryLength()

static size_t getLongestEntryLength ( ArrayRef< SubtargetFeatureKV Table)
static

Return the length of the longest entry in the table.

Definition at line 85 of file SubtargetFeature.cpp.

References I, and llvm::max().

Referenced by Help().

◆ hasFlag()

static bool hasFlag ( StringRef  Feature)
inlinestatic

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

Definition at line 36 of file SubtargetFeature.cpp.

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

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

◆ Help()

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

Display help for feature choices.

Definition at line 93 of file SubtargetFeature.cpp.

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

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

◆ isEnabled()

static bool isEnabled ( StringRef  Feature)
inlinestatic

◆ SetImpliedBits()

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

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

Definition at line 126 of file SubtargetFeature.cpp.

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

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

◆ Split()

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

◆ StripFlag()

static std::string StripFlag ( StringRef  Feature)
inlinestatic

Return string stripped of flag.

Definition at line 45 of file SubtargetFeature.cpp.

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

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