[llvm-commits] [llvm] r80086 - /llvm/trunk/lib/MC/MCMachOStreamer.cpp

Daniel Dunbar daniel at zuster.org
Wed Aug 26 06:57:38 PDT 2009


Author: ddunbar
Date: Wed Aug 26 08:57:37 2009
New Revision: 80086

URL: http://llvm.org/viewvc/llvm-project?rev=80086&view=rev
Log:
llvm-mc: Add symbol entries for undefined symbols used in .fill and .org.

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

Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=80086&r1=80085&r2=80086&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Wed Aug 26 08:57:37 2009
@@ -72,6 +72,14 @@
     : MCStreamer(Context), Assembler(_OS), CurSectionData(0) {}
   ~MCMachOStreamer() {}
 
+  const MCValue &AddValueSymbols(const MCValue &Value) {
+    if (Value.getSymA())
+      getSymbolData(*const_cast<MCSymbol*>(Value.getSymA()));
+    if (Value.getSymB())
+      getSymbolData(*const_cast<MCSymbol*>(Value.getSymB()));
+    return Value;
+  }
+
   /// @name MCStreamer Interface
   /// @{
 
@@ -265,7 +273,7 @@
 }
 
 void MCMachOStreamer::EmitValue(const MCValue &Value, unsigned Size) {
-  new MCFillFragment(Value, Size, 1, CurSectionData);
+  new MCFillFragment(AddValueSymbols(Value), Size, 1, CurSectionData);
 }
 
 void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment,
@@ -283,7 +291,7 @@
 
 void MCMachOStreamer::EmitValueToOffset(const MCValue &Offset,
                                         unsigned char Value) {
-  new MCOrgFragment(Offset, Value, CurSectionData);
+  new MCOrgFragment(AddValueSymbols(Offset), Value, CurSectionData);
 }
 
 void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {





More information about the llvm-commits mailing list