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 origin/main HEAD --extensions cpp -- 
clang-tools-extra/clangd/ParsedAST.cpp 
clang-tools-extra/clangd/unittests/ReplayPeambleTests.cpp 
--diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang-tools-extra/clangd/ParsedAST.cpp 
b/clang-tools-extra/clangd/ParsedAST.cpp
index 728b22301..fddb7703a 100644
--- a/clang-tools-extra/clangd/ParsedAST.cpp
+++ b/clang-tools-extra/clangd/ParsedAST.cpp
@@ -143,9 +143,8 @@ public:
   // the appropriate time.
   // Events will be delivered to the *currently registered* PP callbacks.
   static void attach(std::vector<Inclusion> Includes,
-                    const MainFileMacros &Macros,
-                    CompilerInstance &Clang,
-                    const PreambleBounds &PB) {
+                     const MainFileMacros &Macros, CompilerInstance &Clang,
+                     const PreambleBounds &PB) {
     auto &PP = Clang.getPreprocessor();
     auto *ExistingCallbacks = PP.getPPCallbacks();
     // No need to replay events if nobody is listening.
@@ -161,12 +160,12 @@ public:
   }
 
 private:
-ReplayPreamble(std::vector<Inclusion> Includes, const MainFileMacros &Macros,
-               PPCallbacks *Delegate, const SourceManager &SM,
-               Preprocessor &PP, const LangOptions &LangOpts,
-               const PreambleBounds &PB)
-  : Includes(std::move(Includes)), Macros(Macros), Delegate(Delegate),
-  SM(SM), PP(PP) {
+  ReplayPreamble(std::vector<Inclusion> Includes, const MainFileMacros &Macros,
+                 PPCallbacks *Delegate, const SourceManager &SM,
+                 Preprocessor &PP, const LangOptions &LangOpts,
+                 const PreambleBounds &PB)
+      : Includes(std::move(Includes)), Macros(Macros), Delegate(Delegate),
+        SM(SM), PP(PP) {
     // Only tokenize the preamble section of the main file, as we are not
     // interested in the rest of the tokens.
     MainFileTokens = syntax::tokenize(
@@ -691,7 +690,7 @@ ParsedAST::build(llvm::StringRef Filename, const 
ParseInputs &Inputs,
     Includes.MainFileIncludes = Patch->preambleIncludes();
     // Replay the preamble includes so that clang-tidy checks can see them.
     ReplayPreamble::attach(Patch->preambleIncludes(), Patch->mainFileMacros(),
-                          *Clang, Patch->modifiedBounds());
+                           *Clang, Patch->modifiedBounds());
     PI = *Preamble->Pragmas;
   }
   // Important: collectIncludeStructure is registered *after* ReplayPreamble!

``````````

</details>


https://github.com/llvm/llvm-project/pull/202495
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to