/// EmitIntValue - Special case of EmitValue that avoids the client having
/// to pass in a MCExpr for constant integers.
virtual void EmitIntValue(uint64_t Value, unsigned Size,unsigned AddrSpace);
+
+ /// EmitSymbolValue - Special case of EmitValue that avoids the client
+ /// having to pass in a MCExpr for MCSymbols.
+ virtual void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
+ unsigned AddrSpace);
/// EmitGPRel32Value - Emit the expression @p Value into the output as a
/// gprel32 (32-bit GP relative) value.
OutContext.GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + "set" +
Twine(SetCounter++));
OutStreamer.EmitAssignment(SetLabel, Diff);
-
- OutStreamer.EmitValue(MCSymbolRefExpr::Create(SetLabel, OutContext),
- Size, 0/*AddrSpace*/);
+ OutStreamer.EmitSymbolValue(SetLabel, Size, 0/*AddrSpace*/);
}
// This file contains support for writing dwarf debug info into asm files.
//
//===----------------------------------------------------------------------===//
+
#define DEBUG_TYPE "dwarfdebug"
#include "DwarfDebug.h"
#include "llvm/Module.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCAsmInfo.h"
Asm->EmitInt32(LI->second->getOffset());
if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("low_pc");
- Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(LI->first,
- Asm->OutContext),
- TD->getPointerSize(), 0/*AddrSpace*/);
+ Asm->OutStreamer.EmitSymbolValue(LI->first, TD->getPointerSize(), 0);
}
}
O << SecOffDir << Label->getName();
else {
unsigned Size = IsSmall ? 4 : TD->getPointerSize();
- Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(Label, Asm->OutContext),
- Size, 0/*AddrSpace*/);
+ Asm->OutStreamer.EmitSymbolValue(Label, Size, 0/*AddrSpace*/);
}
}
EmitValue(MCConstantExpr::Create(Value, getContext()), Size, AddrSpace);
}
+void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
+ unsigned AddrSpace) {
+ EmitValue(MCSymbolRefExpr::Create(Sym, getContext()), Size, AddrSpace);
+}
+
/// EmitFill - Emit NumBytes bytes worth of the value specified by
/// FillValue. This implements directives such as '.space'.
void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue,