aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-09-08 16:26:02 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-09-08 19:04:01 -0700
commit523c471250a49b5603bd907ff05535f18ef61c91 (patch)
tree91241ae9d1897992132227f5d66d0a6a8dcf0b09 /clang/lib/Basic/SourceManager.cpp
parenta3ba9d697b17ebb969b86b5c3b34b102fd22e583 (diff)
downloadllvm-523c471250a49b5603bd907ff05535f18ef61c91.zip
llvm-523c471250a49b5603bd907ff05535f18ef61c91.tar.gz
llvm-523c471250a49b5603bd907ff05535f18ef61c91.tar.bz2
Reapply "[clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()`"
This reapplies ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f, except for a tiny part that was reverted separately: 65331da0032ab4253a4bc0ddcb2da67664bd86a9. That will be reapplied later on, since it turned out to be more involved. This commit is enabled by 5523fefb01c282c4cbcaf6314a9aaf658c6c145f and f0f548a65a215c450d956dbcedb03656449705b9, specifically the part that makes 'clang-tidy/checkers/misc/header-include-cycle.cpp' separator agnostic.
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 6fa802a..b8a9fb7 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -1018,7 +1018,7 @@ SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{
/// Return the filename of the file containing a SourceLocation.
StringRef SourceManager::getFilename(SourceLocation SpellingLoc) const {
- if (const FileEntry *F = getFileEntryForID(getFileID(SpellingLoc)))
+ if (OptionalFileEntryRef F = getFileEntryRefForID(getFileID(SpellingLoc)))
return F->getName();
return StringRef();
}