r248077 - Further simplify CGDebugInfo::getOrCreateModuleRef().
Adrian Prantl via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 17:59:22 PDT 2015
Author: adrian
Date: Fri Sep 18 19:59:22 2015
New Revision: 248077
URL: http://llvm.org/viewvc/llvm-project?rev=248077&view=rev
Log:
Further simplify CGDebugInfo::getOrCreateModuleRef().
DIBuilder ignoers DICompileUnits that are passed in as scopes anyway.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=248077&r1=248076&r2=248077&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Sep 18 19:59:22 2015
@@ -1702,19 +1702,17 @@ CGDebugInfo::getOrCreateModuleRef(Extern
}
}
- llvm::DIModule *M = nullptr;
if (CreateSkeletonCU) {
llvm::DIBuilder DIB(CGM.getModule());
- auto *CU = DIB.createCompileUnit(
- TheCU->getSourceLanguage(), Mod.FullModuleName, Mod.Path,
- TheCU->getProducer(), true, StringRef(), 0, Mod.ASTFile,
- llvm::DIBuilder::FullDebug, Mod.Signature);
- M = DIB.createModule(CU, Mod.FullModuleName, ConfigMacros, Mod.Path,
- CGM.getHeaderSearchOpts().Sysroot);
+ DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.FullModuleName,
+ Mod.Path, TheCU->getProducer(), true, StringRef(), 0,
+ Mod.ASTFile, llvm::DIBuilder::FullDebug,
+ Mod.Signature);
DIB.finalize();
- } else
- M = DBuilder.createModule(TheCU, Mod.FullModuleName, ConfigMacros, Mod.Path,
- CGM.getHeaderSearchOpts().Sysroot);
+ }
+ llvm::DIModule *M =
+ DBuilder.createModule(TheCU, Mod.FullModuleName, ConfigMacros, Mod.Path,
+ CGM.getHeaderSearchOpts().Sysroot);
ModRef.reset(M);
return M;
}
More information about the cfe-commits
mailing list