forked from OSchip/llvm-project
add a EmitSymbolValue convenience method to MCStreamer.
llvm-svn: 98017
This commit is contained in:
parent
085b65283c
commit
b14490d912
|
@ -191,6 +191,11 @@ namespace llvm {
|
|||
/// 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.
|
||||
|
|
|
@ -914,9 +914,7 @@ void AsmPrinter::EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo,
|
|||
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*/);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
// 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"
|
||||
|
@ -2970,9 +2970,7 @@ void DwarfDebug::emitDebugInlineInfo() {
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -258,8 +258,7 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
|
|||
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*/);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,11 @@ void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size,
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue