r326099 - [CodeGen][DebugInfo] Refactor duplicated code, NFC
Scott Linder via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 26 08:31:08 PST 2018
Author: scott.linder
Date: Mon Feb 26 08:31:08 2018
New Revision: 326099
URL: http://llvm.org/viewvc/llvm-project?rev=326099&view=rev
Log:
[CodeGen][DebugInfo] Refactor duplicated code, NFC
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=326099&r1=326098&r2=326099&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Feb 26 08:31:08 2018
@@ -388,18 +388,14 @@ CGDebugInfo::computeChecksum(FileID FID,
llvm::DIFile *CGDebugInfo::getOrCreateFile(SourceLocation Loc) {
if (!Loc.isValid())
// If Location is not valid then use main input file.
- return DBuilder.createFile(remapDIPath(TheCU->getFilename()),
- remapDIPath(TheCU->getDirectory()),
- TheCU->getFile()->getChecksum());
+ return getOrCreateMainFile();
SourceManager &SM = CGM.getContext().getSourceManager();
PresumedLoc PLoc = SM.getPresumedLoc(Loc);
if (PLoc.isInvalid() || StringRef(PLoc.getFilename()).empty())
// If the location is not valid then use main input file.
- return DBuilder.createFile(remapDIPath(TheCU->getFilename()),
- remapDIPath(TheCU->getDirectory()),
- TheCU->getFile()->getChecksum());
+ return getOrCreateMainFile();
// Cache the results.
const char *fname = PLoc.getFilename();
More information about the cfe-commits
mailing list