mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 22:43:53 +00:00
[MC] Add interface to finish pending labels.
When manually finishing the object writer in dsymutil, it's possible that there are pending labels that haven't been resolved. This results in an assertion when the assembler tries to fixup a label that doesn't have an address yet. Differential revision: https://reviews.llvm.org/D49131 llvm-svn: 336688
This commit is contained in:
parent
137d0a46b9
commit
714e840719
@ -90,6 +90,9 @@ protected:
|
||||
public:
|
||||
void visitUsedSymbol(const MCSymbol &Sym) override;
|
||||
|
||||
/// Create a dummy fragment to assign any pending labels.
|
||||
void flushPendingLabels() { flushPendingLabels(nullptr); }
|
||||
|
||||
MCAssembler &getAssembler() { return *Assembler; }
|
||||
MCAssembler *getAssemblerPtr() override;
|
||||
/// \name MCStreamer Interface
|
||||
|
@ -671,6 +671,6 @@ void MCObjectStreamer::FinishImpl() {
|
||||
// Dump out the dwarf file & directory tables and line tables.
|
||||
MCDwarfLineTable::Emit(this, getAssembler().getDWARFLinetableParams());
|
||||
|
||||
flushPendingLabels(nullptr);
|
||||
flushPendingLabels();
|
||||
getAssembler().Finish();
|
||||
}
|
||||
|
@ -322,8 +322,10 @@ bool generateDsymCompanion(const DebugMap &DM, MCStreamer &MS,
|
||||
auto &ObjectStreamer = static_cast<MCObjectStreamer &>(MS);
|
||||
MCAssembler &MCAsm = ObjectStreamer.getAssembler();
|
||||
auto &Writer = static_cast<MachObjectWriter &>(MCAsm.getWriter());
|
||||
MCAsmLayout Layout(MCAsm);
|
||||
|
||||
// Layout but don't emit.
|
||||
ObjectStreamer.flushPendingLabels();
|
||||
MCAsmLayout Layout(MCAsm);
|
||||
MCAsm.layout(Layout);
|
||||
|
||||
BinaryHolder InputBinaryHolder(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user