Cache new compile unit.

llvm-svn: 95952
This commit is contained in:
Devang Patel 2010-02-12 01:30:31 +00:00
parent 0827e040e0
commit e003dd1721
1 changed files with 8 additions and 1 deletions

View File

@ -149,9 +149,16 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
RuntimeVers = LO.ObjCNonFragileABI ? 2 : 1;
// Create new compile unit.
return DebugFactory.CreateCompileUnit(
llvm::DICompileUnit Unit = DebugFactory.CreateCompileUnit(
LangTag, AbsFileName.getLast(), AbsFileName.getDirname(), Producer, isMain,
LO.Optimize, CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers);
if (Loc.isValid()) {
PresumedLoc PLoc = SM.getPresumedLoc(Loc);
unsigned FID = PLoc.getIncludeLoc().getRawEncoding();
CompileUnitCache[FID] = Unit;
}
return Unit;
}
/// CreateType - Get the Basic type from the cache or create a new