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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2011-06-30 01:53:36 +00:00
parent ca0ede7655
commit 276365dd4b
68 changed files with 271 additions and 236 deletions

View File

@ -201,7 +201,8 @@ static void DisassembleInput(const StringRef &Filename) {
// it straightforward to switch subtargets on the fly (.e.g,
// the .cpu and .code16 directives).
std::string FeaturesStr;
OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName,
std::string CPU;
OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, CPU,
FeaturesStr));
if (!TM) {
errs() << "error: could not create target for triple " << TripleName << "\n";