From b1aea98cfa357e23f4bb52232da5f41781f23bff Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 25 Sep 2024 10:36:44 -0700 Subject: [clang] Make deprecations of some `FileManager` APIs formal (#110014) Some `FileManager` APIs still return `{File,Directory}Entry` instead of the preferred `{File,Directory}EntryRef`. These are documented to be deprecated, but don't have the attribute that warns on their usage. This PR marks them as such with `LLVM_DEPRECATED()` and replaces their usage with the recommended counterparts. NFCI. --- clang/lib/CodeGen/CodeGenAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenAction.cpp') diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 883333f..c9f9b68 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -586,9 +586,9 @@ const FullSourceLoc BackendConsumer::getBestLocationFromDebugLoc( if (D.isLocationAvailable()) { D.getLocation(Filename, Line, Column); if (Line > 0) { - auto FE = FileMgr.getFile(Filename); + auto FE = FileMgr.getOptionalFileRef(Filename); if (!FE) - FE = FileMgr.getFile(D.getAbsolutePath()); + FE = FileMgr.getOptionalFileRef(D.getAbsolutePath()); if (FE) { // If -gcolumn-info was not used, Column will be 0. This upsets the // source manager, so pass 1 if Column is not set. -- cgit v1.1