[llvm-commits] [llvm] r81380 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp

Bill Wendling isanbard at gmail.com
Wed Sep 9 14:06:24 PDT 2009


Author: void
Date: Wed Sep  9 16:06:24 2009
New Revision: 81380

URL: http://llvm.org/viewvc/llvm-project?rev=81380&view=rev
Log:
Small amount of code clean-up: Don't use ".size()" when not necessary.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81380&r1=81379&r2=81380&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Sep  9 16:06:24 2009
@@ -576,7 +576,7 @@
   const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
   unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
 
-  unsigned TypeOffset = sizeof(int8_t) + // Call site format
+  unsigned TypeOffset = sizeof(int8_t) +   // Call site format
     MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
     SizeSites + SizeActions + SizeTypes;
 
@@ -851,16 +851,18 @@
 void DwarfException::EndModule() {
   if (MAI->getExceptionHandlingType() != ExceptionHandling::Dwarf)
     return;
+
   if (TimePassesIsEnabled)
     ExceptionTimer->startTimer();
 
   if (shouldEmitMovesModule || shouldEmitTableModule) {
     const std::vector<Function *> Personalities = MMI->getPersonalities();
-    for (unsigned i = 0; i < Personalities.size(); ++i)
+
+    for (unsigned i = 0, e = Personalities.size(); i < e; ++i)
       EmitCIE(Personalities[i], i);
 
-    for (std::vector<FunctionEHFrameInfo>::iterator I = EHFrames.begin(),
-           E = EHFrames.end(); I != E; ++I)
+    for (std::vector<FunctionEHFrameInfo>::iterator
+           I = EHFrames.begin(), E = EHFrames.end(); I != E; ++I)
       EmitFDE(*I);
   }
 
@@ -882,7 +884,7 @@
     MMI->TidyLandingPads();
 
     // If any landing pads survive, we need an EH table.
-    if (MMI->getLandingPads().size())
+    if (!MMI->getLandingPads().empty())
       shouldEmitTable = true;
 
     // See if we need frame move info.





More information about the llvm-commits mailing list