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
This commit is contained in:
Evan Cheng
2011-06-30 01:53:36 +00:00
parent 91e5662075
commit fe6e405e8c
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";