[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:17 PDT 2024


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

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

>From e8b7eeffa7ecf364a2be32443599d1d81ba7cfde Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Sat, 6 Jul 2024 19:26:55 -0400
Subject: [PATCH] [IR] enable_if should be enable_if_t in profdata

Template erroneously doesn't include the ::type part. This can be fixed by using enable_if_t.
---
 llvm/lib/IR/ProfDataUtils.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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");



More information about the llvm-commits mailing list