diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-17 23:29:40 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-17 23:29:40 +0000 |
commit | 2879a6caa8d1146946e5c5287d3ff905a2da66bd (patch) | |
tree | b6a61d60cf26eecdbcee9a07543bddb611c9a2d7 /include | |
parent | 9f44c113bdde54e75b8e521da01f5c62492eeb1c (diff) | |
download | llvm-2879a6caa8d1146946e5c5287d3ff905a2da66bd.tar.gz llvm-2879a6caa8d1146946e5c5287d3ff905a2da66bd.tar.bz2 llvm-2879a6caa8d1146946e5c5287d3ff905a2da66bd.tar.xz |
DebugInfo: Move line table zero-directory-index (compilation dir) handling into MCDwarf
Our handling of compilation directory in DwarfDebug was broken
(incorrectly using the 'last' compilation directory (that of the last
CU in the metadata list) for all function emission in any CU). By moving
this handling down into MCDwarf the issue is fixed as the compilation
dir is tracked correctly per line table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCContext.h | 3 | ||||
-rw-r--r-- | include/llvm/MC/MCDwarf.h | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index b51a5a589f..afb94f07bd 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -347,6 +347,9 @@ namespace llvm { void setMCLineTableSymbol(MCSymbol *Sym, unsigned ID) { getMCDwarfLineTable(ID).setLabel(Sym); } + void setMCLineTableCompilationDir(unsigned CUID, StringRef CompilationDir) { + getMCDwarfLineTable(CUID).setCompilationDir(CompilationDir); + } /// setCurrentDwarfLoc - saves the information from the currently parsed /// dwarf .loc directive and sets DwarfLocSeen. When the next instruction diff --git a/include/llvm/MC/MCDwarf.h b/include/llvm/MC/MCDwarf.h index 720da188aa..a578cb24db 100644 --- a/include/llvm/MC/MCDwarf.h +++ b/include/llvm/MC/MCDwarf.h @@ -181,6 +181,8 @@ struct MCDwarfLineTableHeader { SmallVector<std::string, 3> MCDwarfDirs; SmallVector<MCDwarfFile, 3> MCDwarfFiles; StringMap<unsigned> SourceIdMap; + StringRef CompilationDir; + MCDwarfLineTableHeader() : Label(nullptr) {} unsigned getFile(StringRef &Directory, StringRef &FileName, unsigned FileNumber = 0); @@ -209,6 +211,10 @@ public: Header.Label = Label; } + void setCompilationDir(StringRef CompilationDir) { + Header.CompilationDir = CompilationDir; + } + const SmallVectorImpl<std::string> &getMCDwarfDirs() const { return Header.MCDwarfDirs; } |