DebugInfo: Use address pool forms in debug_rnglists
Save no relocations by reusing addresses from the address pool.
llvm-svn: 344836
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
index 0ab9ea8..1e5b7f1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
@@ -109,3 +109,11 @@
SmallVectorImpl<DbgLabel *> &Labels = ScopeLabels[LS];
Labels.push_back(Label);
}
+
+std::pair<uint32_t, RangeSpanList *>
+DwarfFile::addRange(const MCSymbol *&CUBaseAddress,
+ SmallVector<RangeSpan, 2> R) {
+ CURangeLists.push_back(RangeSpanList(Asm->createTempSymbol("debug_ranges"),
+ CUBaseAddress, std::move(R)));
+ return std::make_pair(CURangeLists.size() - 1, &CURangeLists.back());
+}