[llvm-commits] [llvm] r132176 - /llvm/trunk/lib/MC/MCWin64EH.cpp

Charles Davis cdavis at mines.edu
Thu May 26 19:43:19 PDT 2011


Author: cdavis
Date: Thu May 26 21:43:19 2011
New Revision: 132176

URL: http://llvm.org/viewvc/llvm-project?rev=132176&view=rev
Log:
Add missing break statements. Align UNWIND_INFO and RUNTIME_FUNCTION structs
to 4 bytes.

I'm surprised no one caught the missing break statements.

Modified:
    llvm/trunk/lib/MC/MCWin64EH.cpp

Modified: llvm/trunk/lib/MC/MCWin64EH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCWin64EH.cpp?rev=132176&r1=132175&r2=132176&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCWin64EH.cpp (original)
+++ llvm/trunk/lib/MC/MCWin64EH.cpp Thu May 26 21:43:19 2011
@@ -27,17 +27,21 @@
     case Win64EH::UOP_SetFPReg:
     case Win64EH::UOP_PushMachFrame:
       count += 1;
+      break;
     case Win64EH::UOP_SaveNonVol:
     case Win64EH::UOP_SaveXMM128:
       count += 2;
+      break;
     case Win64EH::UOP_SaveNonVolBig:
     case Win64EH::UOP_SaveXMM128Big:
       count += 3;
+      break;
     case Win64EH::UOP_AllocLarge:
       if (I->getSize() > 512*1024-8)
         count += 3;
       else
         count += 2;
+      break;
     }
   }
   return count;
@@ -113,6 +117,7 @@
                                 const MCWin64EHUnwindInfo *info) {
   MCContext &context = streamer.getContext();
 
+  streamer.EmitValueToAlignment(4);
   streamer.EmitValue(MCSymbolRefExpr::Create(info->Begin, context), 4);
   streamer.EmitValue(MCSymbolRefExpr::Create(info->End, context), 4);
   streamer.EmitValue(MCSymbolRefExpr::Create(info->Symbol, context), 4);
@@ -123,6 +128,7 @@
   if (info->Symbol) return;
 
   MCContext &context = streamer.getContext();
+  streamer.EmitValueToAlignment(4);
   // Upper 3 bits are the version number (currently 1).
   uint8_t flags = 0x20;
   info->Symbol = context.CreateTempSymbol();





More information about the llvm-commits mailing list