aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 4f2ec51..9b9e5b9 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -1006,12 +1006,19 @@ void MCStreamer::emitDwarfUnitLength(uint64_t Length, const Twine &Comment) {
emitIntValue(Length, dwarf::getDwarfOffsetByteSize(Context.getDwarfFormat()));
}
-void MCStreamer::emitDwarfUnitLength(const MCSymbol *Hi, const MCSymbol *Lo,
- const Twine &Comment) {
+MCSymbol *MCStreamer::emitDwarfUnitLength(const Twine &Prefix,
+ const Twine &Comment) {
maybeEmitDwarf64Mark();
AddComment(Comment);
+ MCSymbol *Lo = Context.createTempSymbol(Prefix + "_start");
+ MCSymbol *Hi = Context.createTempSymbol(Prefix + "_end");
+
emitAbsoluteSymbolDiff(
Hi, Lo, dwarf::getDwarfOffsetByteSize(Context.getDwarfFormat()));
+ // emit the begin symbol after we generate the length field.
+ emitLabel(Lo);
+ // Return the Hi symbol to the caller.
+ return Hi;
}
void MCStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {