Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/asmjit/asmjit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Moninger <5415177+ZehMatt@users.noreply.github.com>2022-11-10 18:58:41 +0300
committerGitHub <noreply@github.com>2022-11-10 18:58:41 +0300
commit0c03ed2f7497441ac0de232bda2e6b8cc041b2dc (patch)
tree1d93206bae91bca3c459f24e375363d975cd9f3f
parent5af57595a909bbd5114e3503ae88bdbb6169c7ea (diff)
Use static constexpr for RegTraits to make it possible to use asmjit in CLR environment (fixes #386)HEADmaster
-rw-r--r--src/asmjit/core/operand.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/asmjit/core/operand.h b/src/asmjit/core/operand.h
index 02a4093..634acec 100644
--- a/src/asmjit/core/operand.h
+++ b/src/asmjit/core/operand.h
@@ -1082,19 +1082,19 @@ template<> \
struct RegTraits<REG_TYPE> { \
typedef REG RegT; \
\
- enum : uint32_t { \
- kValid = uint32_t(true), \
- kCount = uint32_t(COUNT), \
- kType = uint32_t(REG_TYPE), \
- kGroup = uint32_t(GROUP), \
- kSize = uint32_t(SIZE), \
- kTypeId = uint32_t(TYPE_ID), \
+ static constexpr uint32_t kValid = 1; \
+ static constexpr uint32_t kCount = COUNT; \
+ static constexpr RegType kType = REG_TYPE; \
+ static constexpr RegGroup kGroup = GROUP; \
+ static constexpr uint32_t kSize = SIZE; \
+ static constexpr TypeId kTypeId = TYPE_ID; \
+ \
+ static constexpr uint32_t kSignature = \
+ (OperandSignature::fromOpType(OperandType::kReg) | \
+ OperandSignature::fromRegType(kType) | \
+ OperandSignature::fromRegGroup(kGroup) | \
+ OperandSignature::fromSize(kSize)).bits(); \
\
- kSignature = (OperandSignature::fromOpType(OperandType::kReg) | \
- OperandSignature::fromRegType(REG_TYPE) | \
- OperandSignature::fromRegGroup(GROUP) | \
- OperandSignature::fromSize(kSize)).bits(), \
- }; \
}
//! Adds constructors and member functions to a class that implements abstract register. Abstract register is register
@@ -1135,12 +1135,10 @@ public: \
//! signature.
#define ASMJIT_DEFINE_FINAL_REG(REG, BASE, TRAITS) \
public: \
- enum : uint32_t { \
- kThisType = TRAITS::kType, \
- kThisGroup = TRAITS::kGroup, \
- kThisSize = TRAITS::kSize, \
- kSignature = TRAITS::kSignature \
- }; \
+ static constexpr RegType kThisType = TRAITS::kType; \
+ static constexpr RegGroup kThisGroup = TRAITS::kGroup; \
+ static constexpr uint32_t kThisSize = TRAITS::kSize; \
+ static constexpr uint32_t kSignature = TRAITS::kSignature; \
\
ASMJIT_DEFINE_ABSTRACT_REG(REG, BASE) \
\