[llvm] [NFC] Rename variables to conform to LLVM coding standards (PR #109166)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 09:09:22 PDT 2024


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/109166

None

>From 5e1871d2732fe11ac28c2e6f58162099697999bc Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Wed, 18 Sep 2024 09:06:54 -0700
Subject: [PATCH] [NFC] Rename variables to conform to LLVM coding standards

---
 llvm/utils/TableGen/Common/DAGISelMatcher.cpp | 172 +++++++++---------
 llvm/utils/TableGen/Common/DAGISelMatcher.h   |   6 +-
 llvm/utils/TableGen/DecoderEmitter.cpp        |  77 ++++----
 3 files changed, 128 insertions(+), 127 deletions(-)

diff --git a/llvm/utils/TableGen/Common/DAGISelMatcher.cpp b/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
index d235114871b52c..d38b0992cf0e42 100644
--- a/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
+++ b/llvm/utils/TableGen/Common/DAGISelMatcher.cpp
@@ -17,12 +17,12 @@ using namespace llvm;
 
 void Matcher::anchor() {}
 
-void Matcher::dump() const { print(errs(), 0); }
+void Matcher::dump() const { print(errs()); }
 
-void Matcher::print(raw_ostream &OS, unsigned indent) const {
-  printImpl(OS, indent);
+void Matcher::print(raw_ostream &OS, unsigned Indent) const {
+  printImpl(OS, Indent);
   if (Next)
-    return Next->print(OS, indent);
+    return Next->print(OS, Indent);
 }
 
 void Matcher::printOne(raw_ostream &OS) const { printImpl(OS, 0); }
@@ -111,156 +111,156 @@ unsigned CheckPredicateMatcher::getOperandNo(unsigned i) const {
 
 // printImpl methods.
 
-void ScopeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "Scope\n";
+void ScopeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "Scope\n";
   for (const Matcher *C : Children) {
     if (!C)
-      OS.indent(indent + 1) << "NULL POINTER\n";
+      OS.indent(Indent + 1) << "NULL POINTER\n";
     else
-      C->print(OS, indent + 2);
+      C->print(OS, Indent + 2);
   }
 }
 
-void RecordMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "Record\n";
+void RecordMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "Record\n";
 }
 
-void RecordChildMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "RecordChild: " << ChildNo << '\n';
+void RecordChildMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "RecordChild: " << ChildNo << '\n';
 }
 
-void RecordMemRefMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "RecordMemRef\n";
+void RecordMemRefMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "RecordMemRef\n";
 }
 
 void CaptureGlueInputMatcher::printImpl(raw_ostream &OS,
-                                        unsigned indent) const {
-  OS.indent(indent) << "CaptureGlueInput\n";
+                                        unsigned Indent) const {
+  OS.indent(Indent) << "CaptureGlueInput\n";
 }
 
-void MoveChildMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "MoveChild " << ChildNo << '\n';
+void MoveChildMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "MoveChild " << ChildNo << '\n';
 }
 
 void MoveSiblingMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
   OS.indent(Indent) << "MoveSibling " << SiblingNo << '\n';
 }
 
-void MoveParentMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "MoveParent\n";
+void MoveParentMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "MoveParent\n";
 }
 
-void CheckSameMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckSame " << MatchNumber << '\n';
+void CheckSameMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckSame " << MatchNumber << '\n';
 }
 
-void CheckChildSameMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckChild" << ChildNo << "Same\n";
+void CheckChildSameMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckChild" << ChildNo << "Same\n";
 }
 
 void CheckPatternPredicateMatcher::printImpl(raw_ostream &OS,
-                                             unsigned indent) const {
-  OS.indent(indent) << "CheckPatternPredicate " << Predicate << '\n';
+                                             unsigned Indent) const {
+  OS.indent(Indent) << "CheckPatternPredicate " << Predicate << '\n';
 }
 
-void CheckPredicateMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckPredicate " << getPredicate().getFnName() << '\n';
+void CheckPredicateMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckPredicate " << getPredicate().getFnName() << '\n';
 }
 
-void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckOpcode " << Opcode.getEnumName() << '\n';
+void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckOpcode " << Opcode.getEnumName() << '\n';
 }
 
-void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "SwitchOpcode: {\n";
+void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "SwitchOpcode: {\n";
   for (const auto &C : Cases) {
-    OS.indent(indent) << "case " << C.first->getEnumName() << ":\n";
-    C.second->print(OS, indent + 2);
+    OS.indent(Indent) << "case " << C.first->getEnumName() << ":\n";
+    C.second->print(OS, Indent + 2);
   }
-  OS.indent(indent) << "}\n";
+  OS.indent(Indent) << "}\n";
 }
 
-void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckType " << getEnumName(Type) << ", ResNo=" << ResNo
+void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckType " << getEnumName(Type) << ", ResNo=" << ResNo
                     << '\n';
 }
 
-void SwitchTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "SwitchType: {\n";
+void SwitchTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "SwitchType: {\n";
   for (const auto &C : Cases) {
-    OS.indent(indent) << "case " << getEnumName(C.first) << ":\n";
-    C.second->print(OS, indent + 2);
+    OS.indent(Indent) << "case " << getEnumName(C.first) << ":\n";
+    C.second->print(OS, Indent + 2);
   }
-  OS.indent(indent) << "}\n";
+  OS.indent(Indent) << "}\n";
 }
 
-void CheckChildTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckChildType " << ChildNo << " " << getEnumName(Type)
+void CheckChildTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckChildType " << ChildNo << " " << getEnumName(Type)
                     << '\n';
 }
 
-void CheckIntegerMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckInteger " << Value << '\n';
+void CheckIntegerMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckInteger " << Value << '\n';
 }
 
 void CheckChildIntegerMatcher::printImpl(raw_ostream &OS,
-                                         unsigned indent) const {
-  OS.indent(indent) << "CheckChildInteger " << ChildNo << " " << Value << '\n';
+                                         unsigned Indent) const {
+  OS.indent(Indent) << "CheckChildInteger " << ChildNo << " " << Value << '\n';
 }
 
-void CheckCondCodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckCondCode ISD::" << CondCodeName << '\n';
+void CheckCondCodeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckCondCode ISD::" << CondCodeName << '\n';
 }
 
 void CheckChild2CondCodeMatcher::printImpl(raw_ostream &OS,
-                                           unsigned indent) const {
-  OS.indent(indent) << "CheckChild2CondCode ISD::" << CondCodeName << '\n';
+                                           unsigned Indent) const {
+  OS.indent(Indent) << "CheckChild2CondCode ISD::" << CondCodeName << '\n';
 }
 
-void CheckValueTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckValueType " << getEnumName(VT) << '\n';
+void CheckValueTypeMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckValueType " << getEnumName(VT) << '\n';
 }
 
-void CheckComplexPatMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckComplexPat " << Pattern.getSelectFunc() << '\n';
+void CheckComplexPatMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckComplexPat " << Pattern.getSelectFunc() << '\n';
 }
 
-void CheckAndImmMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckAndImm " << Value << '\n';
+void CheckAndImmMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckAndImm " << Value << '\n';
 }
 
-void CheckOrImmMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckOrImm " << Value << '\n';
+void CheckOrImmMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CheckOrImm " << Value << '\n';
 }
 
 void CheckFoldableChainNodeMatcher::printImpl(raw_ostream &OS,
-                                              unsigned indent) const {
-  OS.indent(indent) << "CheckFoldableChainNode\n";
+                                              unsigned Indent) const {
+  OS.indent(Indent) << "CheckFoldableChainNode\n";
 }
 
 void CheckImmAllOnesVMatcher::printImpl(raw_ostream &OS,
-                                        unsigned indent) const {
-  OS.indent(indent) << "CheckAllOnesV\n";
+                                        unsigned Indent) const {
+  OS.indent(Indent) << "CheckAllOnesV\n";
 }
 
 void CheckImmAllZerosVMatcher::printImpl(raw_ostream &OS,
-                                         unsigned indent) const {
-  OS.indent(indent) << "CheckAllZerosV\n";
+                                         unsigned Indent) const {
+  OS.indent(Indent) << "CheckAllZerosV\n";
 }
 
-void EmitIntegerMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "EmitInteger " << Val << " VT=" << getEnumName(VT)
+void EmitIntegerMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "EmitInteger " << Val << " VT=" << getEnumName(VT)
                     << '\n';
 }
 
 void EmitStringIntegerMatcher::printImpl(raw_ostream &OS,
-                                         unsigned indent) const {
-  OS.indent(indent) << "EmitStringInteger " << Val << " VT=" << getEnumName(VT)
+                                         unsigned Indent) const {
+  OS.indent(Indent) << "EmitStringInteger " << Val << " VT=" << getEnumName(VT)
                     << '\n';
 }
 
-void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "EmitRegister ";
+void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "EmitRegister ";
   if (Reg)
     OS << Reg->getName();
   else
@@ -269,26 +269,26 @@ void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
 }
 
 void EmitConvertToTargetMatcher::printImpl(raw_ostream &OS,
-                                           unsigned indent) const {
-  OS.indent(indent) << "EmitConvertToTarget " << Slot << '\n';
+                                           unsigned Indent) const {
+  OS.indent(Indent) << "EmitConvertToTarget " << Slot << '\n';
 }
 
 void EmitMergeInputChainsMatcher::printImpl(raw_ostream &OS,
-                                            unsigned indent) const {
-  OS.indent(indent) << "EmitMergeInputChains <todo: args>\n";
+                                            unsigned Indent) const {
+  OS.indent(Indent) << "EmitMergeInputChains <todo: args>\n";
 }
 
-void EmitCopyToRegMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "EmitCopyToReg <todo: args>\n";
+void EmitCopyToRegMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "EmitCopyToReg <todo: args>\n";
 }
 
-void EmitNodeXFormMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "EmitNodeXForm " << NodeXForm->getName()
+void EmitNodeXFormMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "EmitNodeXForm " << NodeXForm->getName()
                     << " Slot=" << Slot << '\n';
 }
 
-void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent);
+void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent);
   OS << (isa<MorphNodeToMatcher>(this) ? "MorphNodeTo: " : "EmitNode: ")
      << CGI.Namespace << "::" << CGI.TheDef->getName() << ": <todo flags> ";
 
@@ -300,10 +300,10 @@ void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned indent) const {
   OS << ")\n";
 }
 
-void CompleteMatchMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CompleteMatch <todo args>\n";
-  OS.indent(indent) << "Src = " << Pattern.getSrcPattern() << "\n";
-  OS.indent(indent) << "Dst = " << Pattern.getDstPattern() << "\n";
+void CompleteMatchMatcher::printImpl(raw_ostream &OS, unsigned Indent) const {
+  OS.indent(Indent) << "CompleteMatch <todo args>\n";
+  OS.indent(Indent) << "Src = " << Pattern.getSrcPattern() << "\n";
+  OS.indent(Indent) << "Dst = " << Pattern.getDstPattern() << "\n";
 }
 
 bool CheckOpcodeMatcher::isEqualImpl(const Matcher *M) const {
diff --git a/llvm/utils/TableGen/Common/DAGISelMatcher.h b/llvm/utils/TableGen/Common/DAGISelMatcher.h
index 49dc4726552af6..32924afdda0342 100644
--- a/llvm/utils/TableGen/Common/DAGISelMatcher.h
+++ b/llvm/utils/TableGen/Common/DAGISelMatcher.h
@@ -370,7 +370,7 @@ class MoveParentMatcher : public Matcher {
   static bool classof(const Matcher *N) { return N->getKind() == MoveParent; }
 
 private:
-  void printImpl(raw_ostream &OS, unsigned indent) const override;
+  void printImpl(raw_ostream &OS, unsigned Indent) const override;
   bool isEqualImpl(const Matcher *M) const override { return true; }
 };
 
@@ -389,7 +389,7 @@ class CheckSameMatcher : public Matcher {
   static bool classof(const Matcher *N) { return N->getKind() == CheckSame; }
 
 private:
-  void printImpl(raw_ostream &OS, unsigned indent) const override;
+  void printImpl(raw_ostream &OS, unsigned Indent) const override;
   bool isEqualImpl(const Matcher *M) const override {
     return cast<CheckSameMatcher>(M)->getMatchNumber() == getMatchNumber();
   }
@@ -414,7 +414,7 @@ class CheckChildSameMatcher : public Matcher {
   }
 
 private:
-  void printImpl(raw_ostream &OS, unsigned indent) const override;
+  void printImpl(raw_ostream &OS, unsigned Indent) const override;
   bool isEqualImpl(const Matcher *M) const override {
     return cast<CheckChildSameMatcher>(M)->ChildNo == ChildNo &&
            cast<CheckChildSameMatcher>(M)->MatchNumber == MatchNumber;
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index edecb9067bccf7..d0883647798764 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -163,7 +163,7 @@ class DecoderEmitter {
       : RK(R), Target(R), PredicateNamespace(PredicateNamespace) {}
 
   // Emit the decoder state machine table.
-  void emitTable(formatted_raw_ostream &o, DecoderTable &Table,
+  void emitTable(formatted_raw_ostream &OS, DecoderTable &Table,
                  unsigned Indentation, unsigned BitWidth, StringRef Namespace,
                  const EncodingIDsVec &EncodingIDs) const;
   void emitInstrLenTable(formatted_raw_ostream &OS,
@@ -217,17 +217,17 @@ static bit_value_t bitFromBits(const BitsInit &bits, unsigned index) {
 }
 
 // Prints the bit value for each position.
-static void dumpBits(raw_ostream &o, const BitsInit &bits) {
+static void dumpBits(raw_ostream &OS, const BitsInit &bits) {
   for (unsigned index = bits.getNumBits(); index > 0; --index) {
     switch (bitFromBits(bits, index - 1)) {
     case BIT_TRUE:
-      o << "1";
+      OS << "1";
       break;
     case BIT_FALSE:
-      o << "0";
+      OS << "0";
       break;
     case BIT_UNSET:
-      o << "_";
+      OS << "_";
       break;
     default:
       llvm_unreachable("unexpected return value from bitFromBits");
@@ -497,12 +497,12 @@ class FilterChooser {
 
   /// dumpFilterArray - dumpFilterArray prints out debugging info for the given
   /// filter array as a series of chars.
-  void dumpFilterArray(raw_ostream &o,
+  void dumpFilterArray(raw_ostream &OS,
                        const std::vector<bit_value_t> &filter) const;
 
   /// dumpStack - dumpStack traverses the filter chooser chain and calls
   /// dumpFilterArray on each filter chooser up to the top level one.
-  void dumpStack(raw_ostream &o, const char *prefix) const;
+  void dumpStack(raw_ostream &OS, const char *prefix) const;
 
   Filter &bestFilter() {
     assert(BestIndex != -1 && "BestIndex not set");
@@ -524,7 +524,7 @@ class FilterChooser {
 
   // Emits code to check the Predicates member of an instruction are true.
   // Returns true if predicate matches were emitted, false otherwise.
-  bool emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
+  bool emitPredicateMatch(raw_ostream &OS, unsigned &Indentation,
                           unsigned Opc) const;
   bool emitPredicateMatchAux(const Init &Val, bool ParenIfBinOp,
                              raw_ostream &OS) const;
@@ -543,7 +543,7 @@ class FilterChooser {
   void emitSingletonTableEntry(DecoderTableInfo &TableInfo,
                                const Filter &Best) const;
 
-  void emitBinaryParser(raw_ostream &o, unsigned &Indentation,
+  void emitBinaryParser(raw_ostream &OS, unsigned &Indentation,
                         const OperandInfo &OpInfo,
                         bool &OpHasCompleteDecoder) const;
 
@@ -1083,20 +1083,20 @@ std::pair<bool, uint64_t> FilterChooser::fieldFromInsn(const insn_t &Insn,
 /// dumpFilterArray - dumpFilterArray prints out debugging info for the given
 /// filter array as a series of chars.
 void FilterChooser::dumpFilterArray(
-    raw_ostream &o, const std::vector<bit_value_t> &filter) const {
+    raw_ostream &OS, const std::vector<bit_value_t> &filter) const {
   for (unsigned bitIndex = BitWidth; bitIndex > 0; bitIndex--) {
     switch (filter[bitIndex - 1]) {
     case BIT_UNFILTERED:
-      o << ".";
+      OS << ".";
       break;
     case BIT_UNSET:
-      o << "_";
+      OS << "_";
       break;
     case BIT_TRUE:
-      o << "1";
+      OS << "1";
       break;
     case BIT_FALSE:
-      o << "0";
+      OS << "0";
       break;
     }
   }
@@ -1104,13 +1104,13 @@ void FilterChooser::dumpFilterArray(
 
 /// dumpStack - dumpStack traverses the filter chooser chain and calls
 /// dumpFilterArray on each filter chooser up to the top level one.
-void FilterChooser::dumpStack(raw_ostream &o, const char *prefix) const {
+void FilterChooser::dumpStack(raw_ostream &OS, const char *prefix) const {
   const FilterChooser *current = this;
 
   while (current) {
-    o << prefix;
-    dumpFilterArray(o, current->FilterBitValues);
-    o << '\n';
+    OS << prefix;
+    dumpFilterArray(OS, current->FilterBitValues);
+    OS << '\n';
     current = current->Parent;
   }
 }
@@ -1176,7 +1176,7 @@ unsigned FilterChooser::getIslands(std::vector<unsigned> &StartBits,
   return Num;
 }
 
-void FilterChooser::emitBinaryParser(raw_ostream &o, unsigned &Indentation,
+void FilterChooser::emitBinaryParser(raw_ostream &OS, unsigned &Indentation,
                                      const OperandInfo &OpInfo,
                                      bool &OpHasCompleteDecoder) const {
   const std::string &Decoder = OpInfo.Decoder;
@@ -1184,35 +1184,36 @@ void FilterChooser::emitBinaryParser(raw_ostream &o, unsigned &Indentation,
   bool UseInsertBits = OpInfo.numFields() != 1 || OpInfo.InitValue != 0;
 
   if (UseInsertBits) {
-    o.indent(Indentation) << "tmp = 0x";
-    o.write_hex(OpInfo.InitValue);
-    o << ";\n";
+    OS.indent(Indentation) << "tmp = 0x";
+    OS.write_hex(OpInfo.InitValue);
+    OS << ";\n";
   }
 
   for (const EncodingField &EF : OpInfo) {
-    o.indent(Indentation);
+    OS.indent(Indentation);
     if (UseInsertBits)
-      o << "insertBits(tmp, ";
+      OS << "insertBits(tmp, ";
     else
-      o << "tmp = ";
-    o << "fieldFromInstruction(insn, " << EF.Base << ", " << EF.Width << ')';
+      OS << "tmp = ";
+    OS << "fieldFromInstruction(insn, " << EF.Base << ", " << EF.Width << ')';
     if (UseInsertBits)
-      o << ", " << EF.Offset << ", " << EF.Width << ')';
+      OS << ", " << EF.Offset << ", " << EF.Width << ')';
     else if (EF.Offset != 0)
-      o << " << " << EF.Offset;
-    o << ";\n";
+      OS << " << " << EF.Offset;
+    OS << ";\n";
   }
 
   if (Decoder != "") {
     OpHasCompleteDecoder = OpInfo.HasCompleteDecoder;
-    o.indent(Indentation) << "if (!Check(S, " << Decoder
-                          << "(MI, tmp, Address, Decoder))) { "
-                          << (OpHasCompleteDecoder ? ""
-                                                   : "DecodeComplete = false; ")
-                          << "return MCDisassembler::Fail; }\n";
+    OS.indent(Indentation) << "if (!Check(S, " << Decoder
+                           << "(MI, tmp, Address, Decoder))) { "
+                           << (OpHasCompleteDecoder
+                                   ? ""
+                                   : "DecodeComplete = false; ")
+                           << "return MCDisassembler::Fail; }\n";
   } else {
     OpHasCompleteDecoder = true;
-    o.indent(Indentation) << "MI.addOperand(MCOperand::createImm(tmp));\n";
+    OS.indent(Indentation) << "MI.addOperand(MCOperand::createImm(tmp));\n";
   }
 }
 
@@ -1296,7 +1297,7 @@ bool FilterChooser::emitPredicateMatchAux(const Init &Val, bool ParenIfBinOp,
   return true;
 }
 
-bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
+bool FilterChooser::emitPredicateMatch(raw_ostream &OS, unsigned &Indentation,
                                        unsigned Opc) const {
   ListInit *Predicates =
       AllInstructions[Opc].EncodingDef->getValueAsListInit("Predicates");
@@ -1310,9 +1311,9 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation,
       continue;
 
     if (!IsFirstEmission)
-      o << " && ";
+      OS << " && ";
     if (emitPredicateMatchAux(*Pred->getValueAsDag("AssemblerCondDag"),
-                              Predicates->size() > 1, o))
+                              Predicates->size() > 1, OS))
       PrintFatalError(Pred->getLoc(), "Invalid AssemblerCondDag!");
     IsFirstEmission = false;
   }



More information about the llvm-commits mailing list