llvm-mc: Fix thinko in emitting values.
[oota-llvm.git] / lib / MC / MCAssembler.cpp
index 9efdfe359bbdbfd24ea32073e5bd21351210822c..a01d8de46b225bd84df9c9fc2b7bcc231d848d5b 100644 (file)
@@ -557,6 +557,10 @@ public:
            ie = Asm.symbol_end(); it != ie; ++it) {
       MCSymbol &Symbol = it->getSymbol();
 
+      // Ignore assembler temporaries.
+      if (it->getSymbol().isTemporary())
+        continue;
+
       if (!it->isExternal() && !Symbol.isUndefined())
         continue;
 
@@ -589,6 +593,10 @@ public:
            ie = Asm.symbol_end(); it != ie; ++it) {
       MCSymbol &Symbol = it->getSymbol();
 
+      // Ignore assembler temporaries.
+      if (it->getSymbol().isTemporary())
+        continue;
+
       if (it->isExternal() || Symbol.isUndefined())
         continue;
 
@@ -821,10 +829,10 @@ uint64_t MCFragment::getAddress() const {
 
 /* *** */
 
-MCSectionData::MCSectionData() : Section(*(MCSection*)0) {}
+MCSectionData::MCSectionData() : Section(0) {}
 
 MCSectionData::MCSectionData(const MCSection &_Section, MCAssembler *A)
-  : Section(_Section),
+  : Section(&_Section),
     Alignment(1),
     Address(~UINT64_C(0)),
     Size(~UINT64_C(0)),
@@ -994,7 +1002,7 @@ static void WriteFileData(raw_ostream &OS, const MCFragment &F,
     MCFillFragment &FF = cast<MCFillFragment>(F);
 
     int64_t Value = 0;
-    if (!FF.getValue().isAbsolute())
+    if (FF.getValue().isAbsolute())
       Value = FF.getValue().getConstant();
     for (uint64_t i = 0, e = FF.getCount(); i != e; ++i) {
       if (!FF.getValue().isAbsolute()) {