diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-06-30 01:53:36 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-06-30 01:53:36 +0000 |
commit | fe6e405e8c8a7f75996ef44e4e7ad77c1261dc7a (patch) | |
tree | 03699727329ebc9865d9c41f71be5b1b08c6b31b /llvm/tools/llvm-mc/llvm-mc.cpp | |
parent | 91e56620753d6f717b17b3f9d1336098a60872cd (diff) | |
download | bcm5719-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/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index e2244597af9..b1d9a60ede8 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -309,17 +309,13 @@ static int AssembleInput(const char *ProgName) { // Package up features to be passed to target/subtarget std::string FeaturesStr; - if (MCPU.size()) { - SubtargetFeatures Features; - Features.setCPU(MCPU); - FeaturesStr = Features.getString(); - } // FIXME: We shouldn't need to do this (and link in codegen). // When we split this out, we should do it in a way that makes // it straightforward to switch subtargets on the fly (.e.g, // the .cpu and .code16 directives). OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, + MCPU, FeaturesStr)); if (!TM) { @@ -415,17 +411,13 @@ static int DisassembleInput(const char *ProgName, bool Enhanced) { } else { // Package up features to be passed to target/subtarget std::string FeaturesStr; - if (MCPU.size()) { - SubtargetFeatures Features; - Features.setCPU(MCPU); - FeaturesStr = Features.getString(); - } // FIXME: We shouldn't need to do this (and link in codegen). // When we split this out, we should do it in a way that makes // it straightforward to switch subtargets on the fly (.e.g, // the .cpu and .code16 directives). OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, + MCPU, FeaturesStr)); if (!TM) { |