summaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCContext.h
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-02-05 21:52:47 +0000
committerManman Ren <mren@apple.com>2013-02-05 21:52:47 +0000
commit43213cf1ac05b4198fcf9fa85d7da85477daafd1 (patch)
treeac7b63c63e3625771d1e2d94492927a6d5682320 /include/llvm/MC/MCContext.h
parentbaabdecbb9bf5b32fa81b1e2830ab13076d549f1 (diff)
downloadexternal_llvm-43213cf1ac05b4198fcf9fa85d7da85477daafd1.zip
external_llvm-43213cf1ac05b4198fcf9fa85d7da85477daafd1.tar.gz
external_llvm-43213cf1ac05b4198fcf9fa85d7da85477daafd1.tar.bz2
Dwarf: support for LTO where a single object file can have multiple line tables
We generate one line table for each compilation unit in the object file. Reviewed by Eric and Kevin. rdar://problem/13067005 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCContext.h')
-rw-r--r--include/llvm/MC/MCContext.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h
index f6ae647..20d52eb 100644
--- a/include/llvm/MC/MCContext.h
+++ b/include/llvm/MC/MCContext.h
@@ -144,6 +144,10 @@ namespace llvm {
/// We need a deterministic iteration order, so we remember the order
/// the elements were added.
std::vector<const MCSection *> MCLineSectionOrder;
+ /// The Compile Unit ID that we are currently processing.
+ unsigned DwarfCompileUnitID;
+ /// The line table start symbol for each Compile Unit.
+ DenseMap<unsigned, MCSymbol *> MCLineTableSymbols;
void *MachOUniquingMap, *ELFUniquingMap, *COFFUniquingMap;
@@ -304,6 +308,25 @@ namespace llvm {
MCLineSections[Sec] = Line;
MCLineSectionOrder.push_back(Sec);
}
+ unsigned getDwarfCompileUnitID() {
+ return DwarfCompileUnitID;
+ }
+ void setDwarfCompileUnitID(unsigned CUIndex) {
+ DwarfCompileUnitID = CUIndex;
+ }
+ const DenseMap<unsigned, MCSymbol *> &getMCLineTableSymbols() const {
+ return MCLineTableSymbols;
+ }
+ MCSymbol *getMCLineTableSymbol(unsigned ID) const {
+ DenseMap<unsigned, MCSymbol *>::const_iterator CIter =
+ MCLineTableSymbols.find(ID);
+ if (CIter == MCLineTableSymbols.end())
+ return NULL;
+ return CIter->second;
+ }
+ void setMCLineTableSymbol(MCSymbol *Sym, unsigned ID) {
+ MCLineTableSymbols[ID] = Sym;
+ }
/// setCurrentDwarfLoc - saves the information from the currently parsed
/// dwarf .loc directive and sets DwarfLocSeen. When the next instruction