[llvm] r315911 - [TableGen] Simplify CallingConvEmitter.cpp. NFC.

Javed Absar via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 07:52:27 PDT 2017


Author: javed.absar
Date: Mon Oct 16 07:52:26 2017
New Revision: 315911

URL: http://llvm.org/viewvc/llvm-project?rev=315911&view=rev
Log:
[TableGen] Simplify CallingConvEmitter.cpp. NFC.


Modified:
    llvm/trunk/utils/TableGen/CallingConvEmitter.cpp

Modified: llvm/trunk/utils/TableGen/CallingConvEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CallingConvEmitter.cpp?rev=315911&r1=315910&r2=315911&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CallingConvEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Mon Oct 16 07:52:26 2017
@@ -39,21 +39,21 @@ void CallingConvEmitter::run(raw_ostream
 
   // Emit prototypes for all of the non-custom CC's so that they can forward ref
   // each other.
-  for (unsigned i = 0, e = CCs.size(); i != e; ++i) {
-    if (!CCs[i]->getValueAsBit("Custom")) {
-      O << "static bool " << CCs[i]->getName()
+  for (Record *CC : CCs) {
+    if (!CC->getValueAsBit("Custom")) {
+      O << "static bool " << CC->getName()
         << "(unsigned ValNo, MVT ValVT,\n"
-        << std::string(CCs[i]->getName().size() + 13, ' ')
+        << std::string(CC->getName().size() + 13, ' ')
         << "MVT LocVT, CCValAssign::LocInfo LocInfo,\n"
-        << std::string(CCs[i]->getName().size() + 13, ' ')
+        << std::string(CC->getName().size() + 13, ' ')
         << "ISD::ArgFlagsTy ArgFlags, CCState &State);\n";
     }
   }
 
   // Emit each non-custom calling convention description in full.
-  for (unsigned i = 0, e = CCs.size(); i != e; ++i) {
-    if (!CCs[i]->getValueAsBit("Custom"))
-      EmitCallingConv(CCs[i], O);
+  for (Record *CC : CCs) {
+    if (!CC->getValueAsBit("Custom"))
+      EmitCallingConv(CC, O);
   }
 }
 




More information about the llvm-commits mailing list