From: Timm Bäder Date: Mon, 22 May 2023 13:39:48 +0000 (+0200) Subject: [clang][Diagnostics][NFC] Use getFileID() directly X-Git-Tag: upstream/17.0.6~6687 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb6c036ef378de321d5b7fc0ada317f91c88570d;p=platform%2Fupstream%2Fllvm.git [clang][Diagnostics][NFC] Use getFileID() directly Instead of calling getDecomposedLoc() and then only using the FileID. --- diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index 83f254f..a03c185 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -1144,9 +1144,7 @@ void TextDiagnostic::emitSnippetAndCaret( (LastLevel != DiagnosticsEngine::Note || Level == LastLevel)) return; - // Decompose the location into a FID/Offset pair. - std::pair LocInfo = Loc.getDecomposedLoc(); - FileID FID = LocInfo.first; + FileID FID = Loc.getFileID(); const SourceManager &SM = Loc.getManager(); // Get information about the buffer it points into.