summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-12-24 10:30:04 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-12-24 10:30:04 +0000
commit0b455c2b71a1ec923be2fb17dd232131bd30c5a6 (patch)
tree491a19a4bde041666f866ae09f2b44d5ceadb5c4 /llvm/lib
parent4c66df8584538fd99de45ed555ec6d74efd38ab9 (diff)
downloadbcm5719-llvm-0b455c2b71a1ec923be2fb17dd232131bd30c5a6.tar.gz
bcm5719-llvm-0b455c2b71a1ec923be2fb17dd232131bd30c5a6.zip
Revert rL350048 and rL350050
These patches have broken almost all buildbots on test DebugInfo/X86/addr_comments.ll. Reverting to green. llvm-svn: 350052
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp23
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AddressPool.h2
2 files changed, 9 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp b/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp
index c57e3021710..042243b7925 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp
@@ -24,23 +24,21 @@ unsigned AddressPool::getIndex(const MCSymbol *Sym, bool TLS) {
return IterBool.first->second.Number;
}
-MCSymbol *AddressPool::emitHeader(AsmPrinter &Asm, MCSection *Section) {
+
+void AddressPool::emitHeader(AsmPrinter &Asm, MCSection *Section) {
static const uint8_t AddrSize = Asm.getDataLayout().getPointerSize();
- StringRef Prefix = "debug_addr_";
- MCSymbol *BeginLabel = Asm.createTempSymbol(Prefix + "start");
- MCSymbol *EndLabel = Asm.createTempSymbol(Prefix + "end");
+ uint64_t Length = sizeof(uint16_t) // version
+ + sizeof(uint8_t) // address_size
+ + sizeof(uint8_t) // segment_selector_size
+ + AddrSize * Pool.size(); // entries
Asm.OutStreamer->AddComment("Length of contribution");
- Asm.EmitLabelDifference(EndLabel, BeginLabel,
- 4); // TODO: Support DWARF64 format.
- Asm.OutStreamer->EmitLabel(BeginLabel);
+ Asm.emitInt32(Length); // TODO: Support DWARF64 format.
Asm.OutStreamer->AddComment("DWARF version number");
Asm.emitInt16(Asm.getDwarfVersion());
Asm.OutStreamer->AddComment("Address size");
Asm.emitInt8(AddrSize);
Asm.OutStreamer->AddComment("Segment selector size");
Asm.emitInt8(0); // TODO: Support non-zero segment_selector_size.
-
- return EndLabel;
}
// Emit addresses into the section given.
@@ -51,10 +49,8 @@ void AddressPool::emit(AsmPrinter &Asm, MCSection *AddrSection) {
// Start the dwarf addr section.
Asm.OutStreamer->SwitchSection(AddrSection);
- MCSymbol *EndLabel = nullptr;
-
if (Asm.getDwarfVersion() >= 5)
- EndLabel = emitHeader(Asm, AddrSection);
+ emitHeader(Asm, AddrSection);
// Define the symbol that marks the start of the contribution.
// It is referenced via DW_AT_addr_base.
@@ -71,7 +67,4 @@ void AddressPool::emit(AsmPrinter &Asm, MCSection *AddrSection) {
for (const MCExpr *Entry : Entries)
Asm.OutStreamer->EmitValue(Entry, Asm.getDataLayout().getPointerSize());
-
- if (EndLabel)
- Asm.OutStreamer->EmitLabel(EndLabel);
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/AddressPool.h b/llvm/lib/CodeGen/AsmPrinter/AddressPool.h
index 44a53b02f48..2209c7eb50e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AddressPool.h
+++ b/llvm/lib/CodeGen/AsmPrinter/AddressPool.h
@@ -55,7 +55,7 @@ public:
void setLabel(MCSymbol *Sym) { AddressTableBaseSym = Sym; }
private:
- MCSymbol *emitHeader(AsmPrinter &Asm, MCSection *Section);
+ void emitHeader(AsmPrinter &Asm, MCSection *Section);
/// Symbol designates the start of the contribution to the address table.
MCSymbol *AddressTableBaseSym = nullptr;
OpenPOWER on IntegriCloud