mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89516 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -110,6 +110,33 @@ void SubtargetFeatures::AddFeature(const std::string &String,
|
||||
}
|
||||
}
|
||||
|
||||
/// Add a set of features from the comma-separated string.
|
||||
void SubtargetFeatures::AddFeatures(const std::string &String)
|
||||
{
|
||||
std::vector<std::string> _Features;
|
||||
|
||||
Split(_Features, String);
|
||||
// Nothing is specified.
|
||||
if (_Features.size() == 0)
|
||||
return;
|
||||
|
||||
for (std::vector<std::string>::iterator it = _Features.begin(),
|
||||
end = _Features.end(); it != end; ++it) {
|
||||
// AddFeature will take care of feature string normalization.
|
||||
AddFeature(*it);
|
||||
}
|
||||
}
|
||||
|
||||
/// Add a set of features from the parsed command line parameters.
|
||||
void SubtargetFeatures::AddFeatures(const cl::list<std::string> &List)
|
||||
{
|
||||
for (cl::list<std::string>::const_iterator it = List.begin(),
|
||||
end = List.end(); it != end; ++it) {
|
||||
// AddFeature will take care of feature string normalization.
|
||||
AddFeature(*it);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find KV in array using binary search.
|
||||
template<typename T> const T *Find(const std::string &S, const T *A, size_t L) {
|
||||
// Make the lower bound element we're looking for
|
||||
|
Reference in New Issue
Block a user