[clang][Diagnostics][NFC] Use getFileID() directly
authorTimm Bäder <tbaeder@redhat.com>
Mon, 22 May 2023 13:39:48 +0000 (15:39 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Wed, 31 May 2023 07:57:16 +0000 (09:57 +0200)
Instead of calling getDecomposedLoc() and then only using the FileID.

clang/lib/Frontend/TextDiagnostic.cpp

index 83f254f..a03c185 100644 (file)
@@ -1144,9 +1144,7 @@ void TextDiagnostic::emitSnippetAndCaret(
       (LastLevel != DiagnosticsEngine::Note || Level == LastLevel))
     return;
 
-  // Decompose the location into a FID/Offset pair.
-  std::pair<FileID, unsigned> LocInfo = Loc.getDecomposedLoc();
-  FileID FID = LocInfo.first;
+  FileID FID = Loc.getFileID();
   const SourceManager &SM = Loc.getManager();
 
   // Get information about the buffer it points into.