[llvm] 84e20cb - [TableGen] Minor cleanup in CodeGenRegBank::getConcatSubRegIndex. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 19:04:26 PDT 2024


Author: Craig Topper
Date: 2024-03-22T19:03:43-07:00
New Revision: 84e20cb0cbc64bb2d8299b30da3ce8e6421c203e

URL: https://github.com/llvm/llvm-project/commit/84e20cb0cbc64bb2d8299b30da3ce8e6421c203e
DIFF: https://github.com/llvm/llvm-project/commit/84e20cb0cbc64bb2d8299b30da3ce8e6421c203e.diff

LOG: [TableGen] Minor cleanup in CodeGenRegBank::getConcatSubRegIndex. NFC

Mark a variable const. Capitalize a variable name.

I'm going to add HwMode support to this code and wanted to clean it
up a bit beforehand.

Added: 
    

Modified: 
    llvm/utils/TableGen/CodeGenRegisters.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp
index 40af0d3077b2de..e851d4c16bf7b6 100644
--- a/llvm/utils/TableGen/CodeGenRegisters.cpp
+++ b/llvm/utils/TableGen/CodeGenRegisters.cpp
@@ -1400,11 +1400,11 @@ CodeGenSubRegIndex *CodeGenRegBank::getConcatSubRegIndex(
   // None exists, synthesize one.
   std::string Name = Parts.front()->getName();
   // Determine whether all parts are contiguous.
-  bool isContinuous = true;
+  bool IsContinuous = true;
   unsigned Size = Parts.front()->Size;
   unsigned LastOffset = Parts.front()->Offset;
   unsigned LastSize = Parts.front()->Size;
-  unsigned UnknownSize = (uint16_t)-1;
+  const unsigned UnknownSize = (uint16_t)-1;
   for (unsigned i = 1, e = Parts.size(); i != e; ++i) {
     Name += '_';
     Name += Parts[i]->getName();
@@ -1413,13 +1413,13 @@ CodeGenSubRegIndex *CodeGenRegBank::getConcatSubRegIndex(
     else
       Size += Parts[i]->Size;
     if (LastSize == UnknownSize || Parts[i]->Offset != (LastOffset + LastSize))
-      isContinuous = false;
+      IsContinuous = false;
     LastOffset = Parts[i]->Offset;
     LastSize = Parts[i]->Size;
   }
   Idx = createSubRegIndex(Name, Parts.front()->getNamespace());
   Idx->Size = Size;
-  Idx->Offset = isContinuous ? Parts.front()->Offset : -1;
+  Idx->Offset = IsContinuous ? Parts.front()->Offset : -1;
   Idx->ConcatenationOf.assign(Parts.begin(), Parts.end());
   return Idx;
 }


        


More information about the llvm-commits mailing list