From 308f6630a3f413ab32763bc78ab7802df372751d Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Wed, 25 Nov 2009 22:44:18 +0000 Subject: [PATCH] Rollback changes r89516: 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@89893 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/SubtargetFeature.h | 7 ------- lib/Target/SubtargetFeature.cpp | 27 --------------------------- tools/lto/LTOCodeGenerator.cpp | 13 +++---------- 3 files changed, 3 insertions(+), 44 deletions(-) diff --git a/include/llvm/Target/SubtargetFeature.h b/include/llvm/Target/SubtargetFeature.h index fb5dba1f6db..38a3cc2fefa 100644 --- a/include/llvm/Target/SubtargetFeature.h +++ b/include/llvm/Target/SubtargetFeature.h @@ -22,7 +22,6 @@ #include #include #include "llvm/ADT/Triple.h" -#include "llvm/Support/CommandLine.h" #include "llvm/System/DataTypes.h" namespace llvm { @@ -94,12 +93,6 @@ public: /// Adding Features. void AddFeature(const std::string &String, bool IsEnabled = true); - /// Add a set of features from the comma-separated string. - void AddFeatures(const std::string &String); - - /// Add a set of features from the parsed command line parameters. - void AddFeatures(const cl::list &List); - /// Get feature bits. uint32_t getBits(const SubtargetFeatureKV *CPUTable, size_t CPUTableSize, diff --git a/lib/Target/SubtargetFeature.cpp b/lib/Target/SubtargetFeature.cpp index 1085668a762..590574ef398 100644 --- a/lib/Target/SubtargetFeature.cpp +++ b/lib/Target/SubtargetFeature.cpp @@ -110,33 +110,6 @@ 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 _Features; - - Split(_Features, String); - // Nothing is specified. - if (_Features.size() == 0) - return; - - for (std::vector::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 &List) -{ - for (cl::list::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 const T *Find(const std::string &S, const T *A, size_t L) { // Make the lower bound element we're looking for diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index f079c2e3601..060fc4fdb05 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -304,17 +304,10 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) break; } - // Prepare subtarget feature set for the given command line options. - SubtargetFeatures features; - - // Set the rest of features by default. - // Note: Please keep this after all explict feature settings to make sure - // defaults will not override explicitly set options. - features.AddFeatures( - SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple))); - // construct LTModule, hand over ownership of module and target - _target = march->createTargetMachine(Triple, features.getString()); + const std::string FeatureStr = + SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple)); + _target = march->createTargetMachine(Triple, FeatureStr); } return false; } -- 2.11.0