aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-02-22 23:50:16 +0000
committerEric Christopher <echristo@gmail.com>2013-02-22 23:50:16 +0000
commitff971d7973aaa00c286b788d30f6919c7b1f4de2 (patch)
treef96ce66b346c9d0d8e0ebb42c52567c9539189e0 /lib/CodeGen
parentfdf5706440543c744cd9faf55235a757a7278daa (diff)
Propagate the split dwarf file information through into the backend
and through to the debug info in the module. In order to make the testcase a bit more efficient allow the filename to go through compilation for compile and not assemble jobs and turn off the extract for cases where we don't create an object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 235d15f15b..0dd4d1734d 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -312,6 +312,12 @@ void CGDebugInfo::CreateCompileUnit() {
char *FilenamePtr = DebugInfoNames.Allocate<char>(MainFileName.length());
memcpy(FilenamePtr, MainFileName.c_str(), MainFileName.length());
StringRef Filename(FilenamePtr, MainFileName.length());
+
+ // Save split dwarf file string.
+ std::string SplitDwarfFile = CGM.getCodeGenOpts().SplitDwarfFile;
+ char *SplitDwarfPtr = DebugInfoNames.Allocate<char>(SplitDwarfFile.length());
+ memcpy(SplitDwarfPtr, SplitDwarfFile.c_str(), SplitDwarfFile.length());
+ StringRef SplitDwarfFilename(SplitDwarfPtr, SplitDwarfFile.length());
unsigned LangTag;
const LangOptions &LO = CGM.getLangOpts();
@@ -338,7 +344,8 @@ void CGDebugInfo::CreateCompileUnit() {
// Create new compile unit.
DBuilder.createCompileUnit(LangTag, Filename, getCurrentDirname(),
Producer, LO.Optimize,
- CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers);
+ CGM.getCodeGenOpts().DwarfDebugFlags,
+ RuntimeVers, SplitDwarfFilename);
// FIXME - Eliminate TheCU.
TheCU = llvm::DICompileUnit(DBuilder.getCU());
}