[X86] Read the feature bits from the subtarget that is passed to printInst
authorAkira Hatanaka <ahatanaka@apple.com>
Sat, 28 Mar 2015 20:56:05 +0000 (20:56 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Sat, 28 Mar 2015 20:56:05 +0000 (20:56 +0000)
instead of from MCInstPrinter::AvailableFeatures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233485 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/InstPrinter/X86ATTInstPrinter.h

index cabe4d55c02162adfe2f6e801a85e28acd3dbf7e..f265f1dee9dfd84537003edc232f845bdc66611c 100644 (file)
@@ -57,7 +57,7 @@ void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
   // InstrInfo.td as soon as Requires clause is supported properly
   // for InstAlias.
   if (MI->getOpcode() == X86::CALLpcrel32 &&
   // InstrInfo.td as soon as Requires clause is supported properly
   // for InstAlias.
   if (MI->getOpcode() == X86::CALLpcrel32 &&
-      (getAvailableFeatures() & X86::Mode64Bit) != 0) {
+      (STI.getFeatureBits() & X86::Mode64Bit) != 0) {
     OS << "\tcallq\t";
     printPCRelImm(MI, 0, OS);
   }
     OS << "\tcallq\t";
     printPCRelImm(MI, 0, OS);
   }
index 9ba30d56ea48ba19e0a0ca9ce161b907615836d7..59d52004f2dde4bece9a9835af7627e30e0232ef 100644 (file)
@@ -25,10 +25,7 @@ class X86ATTInstPrinter final : public MCInstPrinter {
 public:
   X86ATTInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
                     const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)
 public:
   X86ATTInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
                     const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)
-      : MCInstPrinter(MAI, MII, MRI) {
-    // Initialize the set of available features.
-    setAvailableFeatures(STI.getFeatureBits());
-  }
+      : MCInstPrinter(MAI, MII, MRI) {}
 
   void printRegName(raw_ostream &OS, unsigned RegNo) const override;
   void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot,
 
   void printRegName(raw_ostream &OS, unsigned RegNo) const override;
   void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot,