summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Linder <scott@scottlinder.com>2018-02-26 16:31:08 +0000
committerScott Linder <scott@scottlinder.com>2018-02-26 16:31:08 +0000
commit39ceac1ceb9997d303750e346cb91e92cdd41d47 (patch)
treea519105a12d203b4007e29c89fbe7df136586ebe
parent31a90468e1e17e7acbd8e0ffff42cd1354550799 (diff)
downloadbcm5719-llvm-39ceac1ceb9997d303750e346cb91e92cdd41d47.tar.gz
bcm5719-llvm-39ceac1ceb9997d303750e346cb91e92cdd41d47.zip
[CodeGen][DebugInfo] Refactor duplicated code, NFC
llvm-svn: 326099
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index bed531eac33..3dab8c38843 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -388,18 +388,14 @@ CGDebugInfo::computeChecksum(FileID FID, SmallString<32> &Checksum) const {
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();
OpenPOWER on IntegriCloud