OSDN Git Service

convert the non-"ispcrel" case of EmitReference to MC,
authorChris Lattner <sabre@nondot.org>
Tue, 9 Mar 2010 23:19:15 +0000 (23:19 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 Mar 2010 23:19:15 +0000 (23:19 +0000)
significant debug info testcases are now all going through
MCStreamer, though they print a lot of extraneous newlines to "O".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98101 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfPrinter.cpp

index 1f1ac52..b255a17 100644 (file)
@@ -213,6 +213,14 @@ void DwarfPrinter::EmitULEB128(unsigned Value, const char *Desc,
 ///
 void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
                                  bool Force32Bit) const {
+  unsigned Size = Force32Bit ? 4 : TD->getPointerSize();
+  
+  if (!IsPCRelative) {
+    Asm->OutStreamer.EmitSymbolValue(Sym, Size, 0/*AddrSpace*/);
+    return;
+  }
+  
+  // FIXME: Need an MCExpr for ".".
   PrintRelDirective(Force32Bit);
   O << *Sym;
   if (IsPCRelative) O << "-" << MAI->getPCSymbol();