[clang] [clang] NFC: Add alias for std::pair<FileID, unsigned> used in SourceLocation (PR #145711)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 26 04:59:15 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- clang/include/clang/Basic/SourceLocation.h clang/include/clang/Basic/SourceManager.h clang/lib/AST/ASTContext.cpp clang/lib/AST/ASTImporter.cpp clang/lib/AST/CommentLexer.cpp clang/lib/AST/Expr.cpp clang/lib/AST/RawCommentList.cpp clang/lib/Analysis/PathDiagnostic.cpp clang/lib/Basic/Diagnostic.cpp clang/lib/Basic/Sarif.cpp clang/lib/Basic/SourceLocation.cpp clang/lib/Basic/SourceManager.cpp clang/lib/Edit/Commit.cpp clang/lib/Frontend/SARIFDiagnostic.cpp clang/lib/Frontend/TextDiagnostic.cpp clang/lib/Index/CommentToXML.cpp clang/lib/Index/USRGeneration.cpp clang/lib/Lex/Lexer.cpp clang/lib/Lex/MacroInfo.cpp clang/lib/Lex/Preprocessor.cpp clang/lib/Parse/ParseStmt.cpp clang/lib/Parse/ParseStmtAsm.cpp clang/lib/Rewrite/Rewriter.cpp clang/lib/Sema/CodeCompleteConsumer.cpp clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaObjCProperty.cpp clang/lib/Serialization/ASTReader.cpp clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp clang/lib/Tooling/Core/Replacement.cpp clang/lib/Tooling/Refactoring/AtomicChange.cpp clang/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp clang/lib/Tooling/Transformer/SourceCode.cpp clang/tools/libclang/CIndex.cpp clang/tools/libclang/CIndexHigh.cpp clang/tools/libclang/CXIndexDataConsumer.cpp clang/tools/libclang/CXSourceLocation.cpp clang/unittests/Lex/LexerTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Tooling/Refactoring/AtomicChange.cpp b/clang/lib/Tooling/Refactoring/AtomicChange.cpp
index 366121e19..13256b52c 100644
--- a/clang/lib/Tooling/Refactoring/AtomicChange.cpp
+++ b/clang/lib/Tooling/Refactoring/AtomicChange.cpp
@@ -196,8 +196,7 @@ combineReplacementsInChanges(llvm::StringRef FilePath,
 AtomicChange::AtomicChange(const SourceManager &SM,
                            SourceLocation KeyPosition) {
   const FullSourceLoc FullKeyPosition(KeyPosition, SM);
-  auto FileIDAndOffset =
-      FullKeyPosition.getSpellingLoc().getDecomposedLoc();
+  auto FileIDAndOffset = FullKeyPosition.getSpellingLoc().getDecomposedLoc();
   OptionalFileEntryRef FE = SM.getFileEntryRefForID(FileIDAndOffset.first);
   assert(FE && "Cannot create AtomicChange with invalid location.");
   FilePath = std::string(FE->getName());

``````````

</details>


https://github.com/llvm/llvm-project/pull/145711


More information about the cfe-commits mailing list