From 17fd7bda5ac08f873c063c64e1456f8960a0c765 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 19 Nov 2010 07:41:23 +0000 Subject: Add a MCLineSectionOrder vector so that we produce the line tables in a deterministic order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119795 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCContext.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/llvm/MC/MCContext.h') diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index cec29fa..7d5258f 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -80,6 +80,9 @@ namespace llvm { /// The dwarf line information from the .loc directives for the sections /// with assembled machine instructions have after seeing .loc directives. DenseMap MCLineSections; + /// We need a deterministic iteration order, so we remember the order + /// the elements were added. + std::vector MCLineSectionOrder; /// Allocator - Allocator object used for creating machine code objects. /// @@ -177,9 +180,18 @@ namespace llvm { const std::vector &getMCDwarfDirs() { return MCDwarfDirs; } - DenseMap &getMCLineSections() { + + const DenseMap + &getMCLineSections() const { return MCLineSections; } + const std::vector &getMCLineSectionOrder() const { + return MCLineSectionOrder; + } + void addMCLineSection(const MCSection *Sec, MCLineSection *Line) { + MCLineSections[Sec] = Line; + MCLineSectionOrder.push_back(Sec); + } /// setCurrentDwarfLoc - saves the information from the currently parsed /// dwarf .loc directive and sets DwarfLocSeen. When the next instruction -- cgit v1.1