diff options
author | Eric Christopher <echristo@gmail.com> | 2013-02-22 23:50:16 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-02-22 23:50:16 +0000 |
commit | f1545838d7127563b161cfe63d27145c6fe5e982 (patch) | |
tree | dfd76a4f1244f4e9ab849cdb256d7ea91bb52f3b /clang/lib/CodeGen | |
parent | dae389bb98c73d4d5a609d415ba00a417832b350 (diff) | |
download | bcm5719-llvm-f1545838d7127563b161cfe63d27145c6fe5e982.tar.gz bcm5719-llvm-f1545838d7127563b161cfe63d27145c6fe5e982.zip |
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.
llvm-svn: 175935
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 235d15f15b2..0dd4d1734d7 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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()); } |