[Mlir-commits] [flang] [clang] [llvm] [libcxx] [clang-tools-extra] [mlir] [openmp] Replace memcpy with std::copy (PR #74663)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Dec 6 14:27:46 PST 2023


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 64454daab0c34d9f3a488979b6b7dfbe315fa9f8 39092c7d3d5acb1cca5927b85e69a98656a22683 -- clang-tools-extra/clang-tidy/modernize/ReplaceMemcpyWithStdCopy.cpp clang-tools-extra/clang-tidy/modernize/ReplaceMemcpyWithStdCopy.h clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
``````````

</details>

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

``````````diff
diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceMemcpyWithStdCopy.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceMemcpyWithStdCopy.cpp
index c4ab6e14f2..fd728e2995 100644
--- a/clang-tools-extra/clang-tidy/modernize/ReplaceMemcpyWithStdCopy.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/ReplaceMemcpyWithStdCopy.cpp
@@ -20,9 +20,9 @@ namespace modernize {
 ReplaceMemcpyWithStdCopy::ReplaceMemcpyWithStdCopy(StringRef Name,
                                                    ClangTidyContext *Context)
     : ClangTidyCheck(Name, Context),
-      IncludeInserter(
-        Options.getLocalOrGlobal(
-          "IncludeStyle", utils::IncludeSorter::IS_LLVM)) {}
+      IncludeInserter(Options.getLocalOrGlobal("IncludeStyle",
+                                               utils::IncludeSorter::IS_LLVM)) {
+}
 
 void ReplaceMemcpyWithStdCopy::registerMatchers(MatchFinder *Finder) {
   assert(Finder != nullptr);
@@ -44,8 +44,8 @@ void ReplaceMemcpyWithStdCopy::registerPPCallbacks(
   if (!getLangOpts().CPlusPlus)
     return;
 
-  Inserter = std::make_unique<utils::IncludeInserter>(SM, getLangOpts(),
-                                                       IncludeStyle);
+  Inserter =
+      std::make_unique<utils::IncludeInserter>(SM, getLangOpts(), IncludeStyle);
   PP->addPPCallbacks(Inserter->CreatePPCallbacks());
 }
 
@@ -67,7 +67,7 @@ void ReplaceMemcpyWithStdCopy::storeOptions(ClangTidyOptions::OptionMap &Opts) {
 }
 
 void ReplaceMemcpyWithStdCopy::renameFunction(DiagnosticBuilder &Diag,
-                                            const CallExpr *MemcpyNode) {
+                                              const CallExpr *MemcpyNode) {
   const CharSourceRange FunctionNameSourceRange = CharSourceRange::getCharRange(
       MemcpyNode->getBeginLoc(), MemcpyNode->getArg(0)->getBeginLoc());
 
@@ -75,7 +75,7 @@ void ReplaceMemcpyWithStdCopy::renameFunction(DiagnosticBuilder &Diag,
 }
 
 void ReplaceMemcpyWithStdCopy::reorderArgs(DiagnosticBuilder &Diag,
-                                         const CallExpr *MemcpyNode) {
+                                           const CallExpr *MemcpyNode) {
   std::array<std::string, 3> arg;
 
   LangOptions LangOpts;
@@ -104,8 +104,8 @@ void ReplaceMemcpyWithStdCopy::reorderArgs(DiagnosticBuilder &Diag,
 }
 
 void ReplaceMemcpyWithStdCopy::insertHeader(DiagnosticBuilder &Diag,
-                                          const CallExpr *MemcpyNode,
-                                          SourceManager *const SM) {
+                                            const CallExpr *MemcpyNode,
+                                            SourceManager *const SM) {
   Optional<FixItHint> FixInclude = Inserter->CreateIncludeInsertion(
       /*FileID=*/SM->getMainFileID(), /*Header=*/"algorithm",
       /*IsAngled=*/true);

``````````

</details>


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


More information about the Mlir-commits mailing list