[llvm] Modernize types and constraints (NFC) (PR #97923)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 6 16:30:46 PDT 2024


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 02c7be5094fa3ffb3f118d9e2d69af435b7c8ef6 b41b5b33ff97c6752284b9562023e35d7ce265e0 -- llvm/lib/IR/AttributeImpl.h llvm/lib/IR/ProfDataUtils.cpp llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp llvm/lib/Target/X86/ImmutableGraph.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/IR/ProfDataUtils.cpp b/llvm/lib/IR/ProfDataUtils.cpp
index deedf64378..7acd1d4f5c 100644
--- a/llvm/lib/IR/ProfDataUtils.cpp
+++ b/llvm/lib/IR/ProfDataUtils.cpp
@@ -66,8 +66,7 @@ bool isTargetMD(const MDNode *ProfData, const char *Name, unsigned MinOps) {
   return ProfDataName->getString() == Name;
 }
 
-template <typename T,
-          typename = std::enable_if_t<std::is_arithmetic_v<T>>>
+template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
 static void extractFromBranchWeightMD(const MDNode *ProfileData,
                                       SmallVectorImpl<T> &Weights) {
   assert(isBranchWeightMD(ProfileData) && "wrong metadata");
diff --git a/llvm/lib/Target/X86/ImmutableGraph.h b/llvm/lib/Target/X86/ImmutableGraph.h
index 53e2d23c0d..3c623c5a57 100644
--- a/llvm/lib/Target/X86/ImmutableGraph.h
+++ b/llvm/lib/Target/X86/ImmutableGraph.h
@@ -294,11 +294,10 @@ private:
 template <typename GraphT> class ImmutableGraphBuilder {
   using node_value_type = typename GraphT::node_value_type;
   using edge_value_type = typename GraphT::edge_value_type;
-  static_assert(
-      std::is_base_of_v<ImmutableGraph<node_value_type, edge_value_type>,
-                      GraphT>,
-      "Template argument to ImmutableGraphBuilder must derive from "
-      "ImmutableGraph<>");
+  static_assert(std::is_base_of_v<
+                    ImmutableGraph<node_value_type, edge_value_type>, GraphT>,
+                "Template argument to ImmutableGraphBuilder must derive from "
+                "ImmutableGraph<>");
   using size_type = typename GraphT::size_type;
   using NodeSet = typename GraphT::NodeSet;
   using Node = typename GraphT::Node;

``````````

</details>


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


More information about the llvm-commits mailing list