[llvm-commits] [llvm] r89893 - in /llvm/trunk: include/llvm/Target/SubtargetFeature.h lib/Target/SubtargetFeature.cpp tools/lto/LTOCodeGenerator.cpp
Viktor Kutuzov
vkutuzov at accesssoftek.com
Wed Nov 25 14:44:18 PST 2009
Author: vkutuzov
Date: Wed Nov 25 16:44:18 2009
New Revision: 89893
URL: http://llvm.org/viewvc/llvm-project?rev=89893&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/Target/SubtargetFeature.h
llvm/trunk/lib/Target/SubtargetFeature.cpp
llvm/trunk/tools/lto/LTOCodeGenerator.cpp
Modified: llvm/trunk/include/llvm/Target/SubtargetFeature.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/SubtargetFeature.h?rev=89893&r1=89892&r2=89893&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/SubtargetFeature.h (original)
+++ llvm/trunk/include/llvm/Target/SubtargetFeature.h Wed Nov 25 16:44:18 2009
@@ -22,7 +22,6 @@
#include <vector>
#include <cstring>
#include "llvm/ADT/Triple.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/System/DataTypes.h"
namespace llvm {
@@ -94,12 +93,6 @@
/// 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<std::string> &List);
-
/// Get feature bits.
uint32_t getBits(const SubtargetFeatureKV *CPUTable,
size_t CPUTableSize,
Modified: llvm/trunk/lib/Target/SubtargetFeature.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SubtargetFeature.cpp?rev=89893&r1=89892&r2=89893&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SubtargetFeature.cpp (original)
+++ llvm/trunk/lib/Target/SubtargetFeature.cpp Wed Nov 25 16:44:18 2009
@@ -110,33 +110,6 @@
}
}
-/// 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
Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=89893&r1=89892&r2=89893&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Wed Nov 25 16:44:18 2009
@@ -304,17 +304,10 @@
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;
}
More information about the llvm-commits
mailing list