[llvm] [IR] enable_if should be enable_if_t in profdata (PR #99334)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 07:56:53 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: AtariDreams (AtariDreams)

<details>
<summary>Changes</summary>

Template erroneously doesn't include the ::type part. This can be fixed by using enable_if_t.

---
Full diff: https://github.com/llvm/llvm-project/pull/99334.diff


1 Files Affected:

- (modified) llvm/lib/IR/ProfDataUtils.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/IR/ProfDataUtils.cpp b/llvm/lib/IR/ProfDataUtils.cpp
index 992ce34e00034..7acd1d4f5c424 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 = typename std::enable_if<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");

``````````

</details>


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


More information about the llvm-commits mailing list