struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
std::set<std::string> FnStubs, GVStubs;
+ const PPCSubtarget &Subtarget;
PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
- : AsmPrinter(O, TM, T) {}
+ : AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
+ }
virtual const char *getPassName() const {
return "PowerPC Assembly Printer";
DarwinAsmPrinter(std::ostream &O, PPCTargetMachine &TM,
const TargetAsmInfo *T)
: PPCAsmPrinter(O, TM, T), DW(O, this, T) {
- bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
+ bool isPPC64 = Subtarget.isPPC64();
}
virtual const char *getPassName() const {
bool DarwinAsmPrinter::doInitialization(Module &M) {
- if (TM.getSubtarget<PPCSubtarget>().isGigaProcessor())
+ if (Subtarget.isGigaProcessor())
O << "\t.machine ppc970\n";
AsmPrinter::doInitialization(M);
// implementation of multiple entry points). If this doesn't occur, the
// linker can safely perform dead code stripping. Since LLVM never generates
// code that does this, it is always safe to set.
- O << "\t.subsections_via_symbols\n";
+ if (Subtarget.isDarwin())
+ O << "\t.subsections_via_symbols\n";
AsmPrinter::doFinalization(M);
return false; // success