[llvm-commits] [llvm] r130273 - /llvm/trunk/lib/MC/MCDwarf.cpp

Rafael Espindola rafael.espindola at gmail.com
Tue Apr 26 18:43:49 PDT 2011


Author: rafael
Date: Tue Apr 26 20:43:49 2011
New Revision: 130273

URL: http://llvm.org/viewvc/llvm-project?rev=130273&view=rev
Log:
Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

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

Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=130273&r1=130272&r2=130273&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Tue Apr 26 20:43:49 2011
@@ -622,14 +622,14 @@
   const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
   const MCSection &section = *asmInfo.getEHFrameSection();
   streamer.SwitchSection(&section);
-  MCSymbol *sectionStart = streamer.getContext().CreateTempSymbol();
+  MCSymbol *sectionStart = context.CreateTempSymbol();
   MCSymbol *sectionEnd = streamer.getContext().CreateTempSymbol();
 
   // Length
   const MCExpr *Length = MakeStartMinusEndExpr(streamer, *sectionStart,
                                                *sectionEnd, 4);
   streamer.EmitLabel(sectionStart);
-  streamer.EmitValue(Length, 4);
+  streamer.EmitAbsValue(Length, 4);
 
   // CIE ID
   streamer.EmitIntValue(0, 4);
@@ -715,13 +715,13 @@
 
   // Length
   const MCExpr *Length = MakeStartMinusEndExpr(streamer, *fdeStart, *fdeEnd, 0);
-  streamer.EmitValue(Length, 4);
+  streamer.EmitAbsValue(Length, 4);
 
   streamer.EmitLabel(fdeStart);
   // CIE Pointer
   const MCExpr *offset = MakeStartMinusEndExpr(streamer, cieStart, *fdeStart,
                                                0);
-  streamer.EmitValue(offset, 4);
+  streamer.EmitAbsValue(offset, 4);
   unsigned fdeEncoding = asmInfo.getFDEEncoding();
   unsigned size = getSizeForEncoding(streamer, fdeEncoding);
 
@@ -731,7 +731,7 @@
   // PC Range
   const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin,
                                               *frame.End, 0);
-  streamer.EmitValue(Range, size);
+  streamer.EmitAbsValue(Range, size);
 
   // Augmentation Data Length
   MCSymbol *augmentationStart = streamer.getContext().CreateTempSymbol();
@@ -751,7 +751,7 @@
   EmitCFIInstructions(streamer, frame.Instructions, frame.Begin);
 
   // Padding
-  streamer.EmitValueToAlignment(4);
+  streamer.EmitValueToAlignment(size);
 
   return fdeEnd;
 }





More information about the llvm-commits mailing list