Invert the meaning of printAliasInstr's return value. It now returns
authorEric Christopher <echristo@apple.com>
Mon, 18 Apr 2011 21:28:11 +0000 (21:28 +0000)
committerEric Christopher <echristo@apple.com>
Mon, 18 Apr 2011 21:28:11 +0000 (21:28 +0000)
true on success and false on failure. Update callers.

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

lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
utils/TableGen/AsmWriterEmitter.cpp

index 69a069e438b3a5447d06af90b1e0bbed0975faf1..dd6e3533849d2fbe09130236d8930916867ae72f 100644 (file)
@@ -42,7 +42,8 @@ X86ATTInstPrinter::X86ATTInstPrinter(TargetMachine &TM, const MCAsmInfo &MAI)
 }
 
 void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) {
-  if (printAliasInstr(MI, OS))
+  // Try to print any aliases first.
+  if (!printAliasInstr(MI, OS))
     printInstruction(MI, OS);
   
   // If verbose assembly is enabled, we can print some informative comments.
index f24674f68e3ad35f99e58a3f5f0f628811704014..8d69391c968b33e2a87810cc32619e736c54db83 100644 (file)
@@ -31,6 +31,8 @@ public:
 
   // Methods used to print the alias of an instruction.
   unsigned ComputeAvailableFeatures(const X86Subtarget *Subtarget) const;
+  // Autogenerated by tblgen, returns true if we successfully printed an
+  // alias.
   bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
 
   // Autogenerated by tblgen.
index f9686fd9b5ad3f54e0fe763e38955743d5057558..2b1a4cc8a3d472d0b421d8ed885396c317fa16cf 100644 (file)
@@ -975,11 +975,11 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
       CasesO << '\n';
     }
 
-    CasesO.indent(4) << "return true;\n";
+    CasesO.indent(4) << "return false;\n";
   }
 
   if (CasesO.str().empty() || !isMC) {
-    O << "  return true;\n";
+    O << "  return false;\n";
     O << "}\n\n";
     O << "#endif // PRINT_ALIAS_INSTR\n";
     return;
@@ -990,7 +990,7 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
   if (NeedAvailableFeatures)
     O.indent(2) << "unsigned AvailableFeatures = getAvailableFeatures();\n\n";
   O.indent(2) << "switch (MI->getOpcode()) {\n";
-  O.indent(2) << "default: return true;\n";
+  O.indent(2) << "default: return false;\n";
   O << CasesO.str();
   O.indent(2) << "}\n\n";
 
@@ -1019,7 +1019,7 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
   O << "    }\n";
   O << "  }\n\n";
   
-  O << "  return false;\n";
+  O << "  return true;\n";
   O << "}\n\n";
 
   O << "#endif // PRINT_ALIAS_INSTR\n";