diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-19 07:41:23 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-19 07:41:23 +0000 |
commit | 17fd7bda5ac08f873c063c64e1456f8960a0c765 (patch) | |
tree | 077a1fa16b5dd56671d633b7cd5b7306d366a728 /include/llvm/MC/MCContext.h | |
parent | 1f190c8bdf1d74c029c85b0865c983f3f9cafb31 (diff) | |
download | external_llvm-17fd7bda5ac08f873c063c64e1456f8960a0c765.zip external_llvm-17fd7bda5ac08f873c063c64e1456f8960a0c765.tar.gz external_llvm-17fd7bda5ac08f873c063c64e1456f8960a0c765.tar.bz2 |
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
Diffstat (limited to 'include/llvm/MC/MCContext.h')
-rw-r--r-- | include/llvm/MC/MCContext.h | 14 |
1 files changed, 13 insertions, 1 deletions
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<const MCSection *, MCLineSection *> MCLineSections; + /// We need a deterministic iteration order, so we remember the order + /// the elements were added. + std::vector<const MCSection *> MCLineSectionOrder; /// Allocator - Allocator object used for creating machine code objects. /// @@ -177,9 +180,18 @@ namespace llvm { const std::vector<StringRef> &getMCDwarfDirs() { return MCDwarfDirs; } - DenseMap<const MCSection *, MCLineSection *> &getMCLineSections() { + + const DenseMap<const MCSection *, MCLineSection *> + &getMCLineSections() const { return MCLineSections; } + const std::vector<const MCSection *> &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 |