aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorRichard Mitton <richard@codersnotes.com>2013-09-19 23:21:01 +0000
committerRichard Mitton <richard@codersnotes.com>2013-09-19 23:21:01 +0000
commit5cc319a42a914b24b164a94d9a563c728a7a4026 (patch)
tree2101b566f8fb8e3eea815cf1e29fc86c632a322a /include/llvm/MC
parent70e0b047be83cbaca06c0cc72e508667bcd5e95f (diff)
downloadexternal_llvm-5cc319a42a914b24b164a94d9a563c728a7a4026.zip
external_llvm-5cc319a42a914b24b164a94d9a563c728a7a4026.tar.gz
external_llvm-5cc319a42a914b24b164a94d9a563c728a7a4026.tar.bz2
Added support for generate DWARF .debug_aranges sections automatically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCELFStreamer.h2
-rw-r--r--include/llvm/MC/MCStreamer.h19
2 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/MC/MCELFStreamer.h b/include/llvm/MC/MCELFStreamer.h
index bff0cba..76369cc 100644
--- a/include/llvm/MC/MCELFStreamer.h
+++ b/include/llvm/MC/MCELFStreamer.h
@@ -85,6 +85,8 @@ public:
virtual void EmitValueToAlignment(unsigned, int64_t, unsigned, unsigned);
+ virtual void Flush();
+
virtual void FinishImpl();
/// @}
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h
index cd297a4..8cb5c49 100644
--- a/include/llvm/MC/MCStreamer.h
+++ b/include/llvm/MC/MCStreamer.h
@@ -86,6 +86,10 @@ private:
MCSymbol *LastSymbol;
+ // SymbolOrdering - Tracks an index to represent the order
+ // a symbol was emitted in. Zero means we did not emit that symbol.
+ DenseMap<const MCSymbol *, unsigned> SymbolOrdering;
+
/// SectionStack - This is stack of current and previous section
/// values saved by PushSection.
SmallVector<std::pair<MCSectionSubPair, MCSectionSubPair>, 4> SectionStack;
@@ -185,6 +189,12 @@ public:
return MCSectionSubPair();
}
+ /// GetSymbolOrder - Returns an index to represent the order
+ /// a symbol was emitted in. (zero if we did not emit that symbol)
+ unsigned GetSymbolOrder(const MCSymbol *Sym) const {
+ return SymbolOrdering.lookup(Sym);
+ }
+
/// ChangeSection - Update streamer for a new active section.
///
/// This is called by PopSection and SwitchSection, if the current
@@ -264,6 +274,12 @@ public:
/// InitToTextSection - Create a text section and switch the streamer to it.
virtual void InitToTextSection() = 0;
+ /// AssignSection - Sets the symbol's section.
+ ///
+ /// Each emitted symbol will be tracked in the ordering table,
+ /// so we can sort on them later.
+ void AssignSection(MCSymbol *Symbol, const MCSection *Section);
+
/// EmitLabel - Emit a label for @p Symbol into the current section.
///
/// This corresponds to an assembler statement such as:
@@ -620,6 +636,9 @@ public:
/// these methods there.
virtual void EmitTCEntry(const MCSymbol &S);
+ /// Flush - Causes any cached state to be written out.
+ virtual void Flush() {}
+
/// FinishImpl - Streamer specific finalization.
virtual void FinishImpl() = 0;
/// Finish - Finish emission of machine code.