File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -563,20 +563,18 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(const PresumedLoc &PLoc) {
563563 StringRef FileName;
564564 FileID FID;
565565 std::optional<llvm::DIFile::ChecksumInfo<StringRef>> CSInfo;
566-
566+ SourceManager &SM = CGM. getContext (). getSourceManager ();
567567 if (PLoc.isInvalid ()) {
568568 // The DIFile used by the CU is distinct from the main source file. Call
569569 // createFile() below for canonicalization if the source file was specified
570570 // with an absolute path.
571571 FileName = TheCU->getFile ()->getFilename ();
572572 CSInfo = TheCU->getFile ()->getChecksum ();
573+ FID = SM.getFileID (SourceLocation ());
573574 } else {
574575 FileName = PLoc.getFilename ();
575-
576576 if (FileName.empty ()) {
577577 FileName = TheCU->getFile ()->getFilename ();
578- } else {
579- FileName = PLoc.getFilename ();
580578 }
581579 FID = PLoc.getFileID ();
582580 }
@@ -597,8 +595,7 @@ llvm::DIFile *CGDebugInfo::getOrCreateFile(const PresumedLoc &PLoc) {
597595 if (CSKind)
598596 CSInfo.emplace (*CSKind, Checksum);
599597 }
600- SourceManager &SM = CGM.getContext ().getSourceManager ();
601- return createFile (FileName, CSInfo, getSource (SM, PLoc.getFileID ()));
598+ return createFile (FileName, CSInfo, getSource (SM, FID));
602599}
603600
604601llvm::DIFile *CGDebugInfo::createFile (
You can’t perform that action at this time.
0 commit comments