Skip to content

Commit 715257e

Browse files
committed
[clang] NFCI: Use FileEntryRef in Sarif.cpp
1 parent 6966c06 commit 715257e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/Basic/Sarif.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ using namespace llvm;
3636
using clang::detail::SarifArtifact;
3737
using clang::detail::SarifArtifactLocation;
3838

39-
static StringRef getFileName(const FileEntry &FE) {
40-
StringRef Filename = FE.tryGetRealPathName();
39+
static StringRef getFileName(FileEntryRef FE) {
40+
StringRef Filename = FE.getFileEntry().tryGetRealPathName();
4141
if (Filename.empty())
4242
Filename = FE.getName();
4343
return Filename;
@@ -215,8 +215,8 @@ SarifDocumentWriter::createPhysicalLocation(const CharSourceRange &R) {
215215
assert(R.isCharRange() &&
216216
"Cannot create a physicalLocation from a token range!");
217217
FullSourceLoc Start{R.getBegin(), SourceMgr};
218-
const FileEntry *FE = Start.getExpansionLoc().getFileEntry();
219-
assert(FE != nullptr && "Diagnostic does not exist within a valid file!");
218+
OptionalFileEntryRef FE = Start.getExpansionLoc().getFileEntryRef();
219+
assert(FE && "Diagnostic does not exist within a valid file!");
220220

221221
const std::string &FileURI = fileNameToURI(getFileName(*FE));
222222
auto I = CurrentArtifacts.find(FileURI);

0 commit comments

Comments
 (0)