Archived
Use musttail attribute for Clang 13+
This commit is contained in:
@@ -82,6 +82,12 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(M3_COMPILER_CLANG) && __clang_major__ >= 13
|
||||
# define M3_MUSTTAIL __attribute__((musttail))
|
||||
# else
|
||||
# define M3_MUSTTAIL
|
||||
# endif
|
||||
|
||||
# ifndef M3_MIN
|
||||
# define M3_MIN(A,B) (((A) < (B)) ? (A) : (B))
|
||||
# endif
|
||||
|
||||
+2
-2
@@ -47,10 +47,10 @@ d_m3BeginExternC
|
||||
|
||||
# if d_m3EnableOpProfiling
|
||||
d_m3RetSig profileOp (d_m3OpSig, cstr_t i_operationName);
|
||||
# define nextOp() return profileOp (d_m3OpAllArgs, __FUNCTION__)
|
||||
# define nextOp() M3_MUSTTAIL return profileOp (d_m3OpAllArgs, __FUNCTION__)
|
||||
# elif d_m3EnableOpTracing
|
||||
d_m3RetSig debugOp (d_m3OpSig, cstr_t i_operationName);
|
||||
# define nextOp() return debugOp (d_m3OpAllArgs, __FUNCTION__)
|
||||
# define nextOp() M3_MUSTTAIL return debugOp (d_m3OpAllArgs, __FUNCTION__)
|
||||
# else
|
||||
# define nextOp() nextOpDirect()
|
||||
# endif
|
||||
|
||||
@@ -50,8 +50,8 @@ typedef m3ret_t (vectorcall * IM3Operation) (d_m3OpSig);
|
||||
#define nextOpImpl() ((IM3Operation)(* _pc))(_pc + 1, d_m3OpArgs)
|
||||
#define jumpOpImpl(PC) ((IM3Operation)(* PC))( PC + 1, d_m3OpArgs)
|
||||
|
||||
#define nextOpDirect() return nextOpImpl()
|
||||
#define jumpOpDirect(PC) return jumpOpImpl((pc_t)(PC))
|
||||
#define nextOpDirect() M3_MUSTTAIL return nextOpImpl()
|
||||
#define jumpOpDirect(PC) M3_MUSTTAIL return jumpOpImpl((pc_t)(PC))
|
||||
|
||||
d_m3RetSig RunCode (d_m3OpSig)
|
||||
{
|
||||
|
||||
@@ -267,6 +267,11 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Bit ops
|
||||
*/
|
||||
#define m3_isBitSet(val, pos) ((val & (1 << pos)) != 0)
|
||||
|
||||
/*
|
||||
* Other
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user