summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/TargetSelect.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-06-30 01:53:36 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-06-30 01:53:36 +0000
commitfe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a (patch)
tree03699727329ebc9865d9c41f71be5b1b08c6b31b /llvm/lib/ExecutionEngine/TargetSelect.cpp
parent91e56620753d6f717b17b3f9d1336098a60872cd (diff)
downloadbcm5719-llvm-fe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a.tar.gz
bcm5719-llvm-fe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a.zip
Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! llvm-svn: 134127
Diffstat (limited to 'llvm/lib/ExecutionEngine/TargetSelect.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/TargetSelect.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/TargetSelect.cpp b/llvm/lib/ExecutionEngine/TargetSelect.cpp
index 83b1f0542c3..f51aff3603b 100644
--- a/llvm/lib/ExecutionEngine/TargetSelect.cpp
+++ b/llvm/lib/ExecutionEngine/TargetSelect.cpp
@@ -75,9 +75,8 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
// Package up features to be passed to target/subtarget
std::string FeaturesStr;
- if (!MCPU.empty() || !MAttrs.empty()) {
+ if (!MAttrs.empty()) {
SubtargetFeatures Features;
- Features.setCPU(MCPU);
for (unsigned i = 0; i != MAttrs.size(); ++i)
Features.AddFeature(MAttrs[i]);
FeaturesStr = Features.getString();
@@ -85,7 +84,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
// Allocate a target...
TargetMachine *Target =
- TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr);
+ TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr);
assert(Target && "Could not allocate target machine!");
return Target;
}
OpenPOWER on IntegriCloud