]> granicus.if.org Git - llvm/commitdiff
[GlobalISel] Separate matchers with newlines in emitted selector. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Sat, 4 Feb 2017 00:47:02 +0000 (00:47 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Sat, 4 Feb 2017 00:47:02 +0000 (00:47 +0000)
We don't try very hard to format the emitted code, but newlines
are an easy way to make it more readable.

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

utils/TableGen/GlobalISelEmitter.cpp

index 1886f75c49c8488d4aa4c6d64fae3f7f5590b0bb..1d16c5cb6c19844d84daf44b403922989a331155 100644 (file)
@@ -143,7 +143,7 @@ public:
       OS << Separator << "(";
       Predicate->emitCxxPredicateExpr(OS, std::forward<Args>(args)...);
       OS << ")";
-      Separator = " && ";
+      Separator = " &&\n";
     }
   }
 };
@@ -276,7 +276,7 @@ public:
   void emitCxxPredicateExpr(raw_ostream &OS, const StringRef InsnVarName) const {
     emitCxxPredicateListExpr(OS, InsnVarName);
     for (const auto &Operand : Operands) {
-      OS << " && (";
+      OS << " &&\n(";
       Operand.emitCxxPredicateExpr(OS, InsnVarName);
       OS << ")";
     }
@@ -359,7 +359,7 @@ public:
 
     OS << "    constrainSelectedInstRegOperands(I, TII, TRI, RBI);\n";
     OS << "    return true;\n";
-    OS << "  }\n";
+    OS << "  }\n\n";
   }
 };
 
@@ -515,7 +515,7 @@ void GlobalISelEmitter::run(raw_ostream &OS) {
   OS << "bool " << Target.getName()
      << "InstructionSelector::selectImpl"
         "(MachineInstr &I) const {\n  const MachineRegisterInfo &MRI = "
-        "I.getParent()->getParent()->getRegInfo();\n";
+        "I.getParent()->getParent()->getRegInfo();\n\n";
 
   // Look through the SelectionDAG patterns we found, possibly emitting some.
   for (const PatternToMatch &Pat : CGP.ptms()) {