[llvm] [AMDGPU] Simplify GetMember...::Get (NFC) (PR #137536)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 27 12:34:02 PDT 2025
================
@@ -72,17 +72,14 @@ using namespace llvm::AMDGPU;
class GetMember##member { \
public: \
static const MCExpr *Phony; \
- template <typename U, typename std::enable_if_t<IsMCExpr##member::RESULT, \
- U> * = nullptr> \
- static const MCExpr *&Get(U &C) { \
- assert(IsMCExpr##member::RESULT && \
- "Trying to retrieve member that does not exist."); \
- return C.member; \
- } \
- template <typename U, typename std::enable_if_t<!IsMCExpr##member::RESULT, \
- U> * = nullptr> \
- static const MCExpr *&Get(U &C) { \
- return Phony; \
+ template <typename U> static const MCExpr *&Get(U &C) { \
+ if constexpr (IsMCExpr##member::RESULT) { \
+ assert(IsMCExpr##member::RESULT && \
+ "Trying to retrieve member that does not exist."); \
----------------
kazutakahirata wrote:
Ah, thank you for pointing this out!
https://github.com/llvm/llvm-project/pull/137536
More information about the llvm-commits
mailing list