llvm.org GIT mirror llvm / 9a7dfa3
Rollback changes to take a different tack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32488 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Laskey 13 years ago
4 changed file(s) with 5 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
8080 /// Set the CPU string. Replaces previous setting. Setting to "" clears CPU.
8181 void setCPU(const std::string &String);
8282
83 /// Get the CPU string.
84 const std::string &getCPU() const { return Features[0]; }
85
8683 /// Setting CPU string only if no string is set.
8784 void setCPUIfNone(const std::string &String);
8885
2626 class TargetSubtarget {
2727 TargetSubtarget(const TargetSubtarget&); // DO NOT IMPLEMENT
2828 void operator=(const TargetSubtarget&); // DO NOT IMPLEMENT
29 std::string CPU; // CPU name.
3029 protected: // Can only create subclasses...
3130 TargetSubtarget();
3231 public:
3332 virtual ~TargetSubtarget();
34 void setCPU(const std::string &C) { CPU = C; }
35 const std::string &getCPU() const { return CPU; }
3633 };
3734
3835 } // End llvm namespace
541541
542542
543543 bool DarwinAsmPrinter::doInitialization(Module &M) {
544 #if 1
545 if (Subtarget.isGigaProcessor())
546 O << "\t.machine ppc970\n";
547 #else
544548 const std::string &CPU = Subtarget.getCPU();
545549
546550 if (CPU != "generic")
553557 O << "\t.machine ppc7400\n";
554558 else
555559 O << "\t.machine ppc\n";
560 #endif
556561
557562 AsmPrinter::doInitialization(M);
558563
459459 " const std::string &CPU) {\n"
460460 " SubtargetFeatures Features(FS);\n"
461461 " Features.setCPUIfNone(CPU);\n"
462 " setCPU(Features.getCPU());\n"
463462 " uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize,\n"
464463 " FeatureKV, FeatureKVSize);\n";
465464