Skip to content

Commit d582c55

Browse files
author
Amjad Aboud
committed
[DebugInfo] Changed DIBuilder::createCompileUnit() to take DIFile instead of FileName and Directory.
This way it will be easier to expand DIFile (e.g., to contain checksum) without the need to modify the createCompileUnit() API. Reviewers: cfe-commits, rnk Differential Revision: https://reviews.llvm.org/D27763 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289701 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 3338f4e commit d582c55

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/CodeGen/CGDebugInfo.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ void CGDebugInfo::CreateCompileUnit() {
466466
// Create new compile unit.
467467
// FIXME - Eliminate TheCU.
468468
TheCU = DBuilder.createCompileUnit(
469-
LangTag, remapDIPath(MainFileName), remapDIPath(getCurrentDirname()),
469+
LangTag, DBuilder.createFile(remapDIPath(MainFileName),
470+
remapDIPath(getCurrentDirname())),
470471
Producer, LO.Optimize, CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers,
471472
CGM.getCodeGenOpts().SplitDwarfFile, EmissionKind, 0 /* DWOid */,
472473
CGM.getCodeGenOpts().SplitDwarfInlining);
@@ -1977,10 +1978,11 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod,
19771978
// but LLVM detects skeleton CUs by looking for a non-zero DWO id.
19781979
uint64_t Signature = Mod.getSignature() ? Mod.getSignature() : ~1ULL;
19791980
llvm::DIBuilder DIB(CGM.getModule());
1980-
DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.getModuleName(),
1981-
Mod.getPath(), TheCU->getProducer(), true,
1982-
StringRef(), 0, Mod.getASTFile(),
1983-
llvm::DICompileUnit::FullDebug, Signature);
1981+
DIB.createCompileUnit(TheCU->getSourceLanguage(),
1982+
DIB.createFile(Mod.getModuleName(), Mod.getPath()),
1983+
TheCU->getProducer(), true, StringRef(), 0,
1984+
Mod.getASTFile(), llvm::DICompileUnit::FullDebug,
1985+
Signature);
19841986
DIB.finalize();
19851987
}
19861988
llvm::DIModule *Parent =

0 commit comments

Comments
 (0)