diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-09-08 16:26:02 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-09-08 19:04:01 -0700 |
commit | 523c471250a49b5603bd907ff05535f18ef61c91 (patch) | |
tree | 91241ae9d1897992132227f5d66d0a6a8dcf0b09 /clang/lib/Frontend/FrontendAction.cpp | |
parent | a3ba9d697b17ebb969b86b5c3b34b102fd22e583 (diff) | |
download | llvm-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/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index e016b94..7912ff0 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -666,7 +666,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, } else { auto &OldSM = AST->getSourceManager(); FileID ID = OldSM.getMainFileID(); - if (auto *File = OldSM.getFileEntryForID(ID)) + if (auto File = OldSM.getFileEntryRefForID(ID)) Input = FrontendInputFile(File->getName(), Kind); else Input = FrontendInputFile(OldSM.getBufferOrFake(ID), Kind); @@ -844,7 +844,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, return false; } // We now have the filename... - FileName = FE->getFileEntry().getName(); + FileName = FE->getName(); // ... still a header unit, but now use the path as written. Kind = Input.getKind().withHeaderUnit(InputKind::HeaderUnit_Abs); Input = FrontendInputFile(FileName, Kind, Input.isSystem()); |