Make asmjit compile with all possible ASMJIT_DISABLE_... options

This commit is contained in:
kobalicek
2017-02-02 00:48:05 +01:00
parent 0943382a0c
commit fa43c7be07
3 changed files with 16 additions and 5 deletions

View File

@@ -110,7 +110,7 @@ protected:
Error err, Error err,
uint32_t instId, uint32_t options, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3); uint32_t instId, uint32_t options, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3);
#else #else
ASMJIT_INLINE _emitFailed( ASMJIT_INLINE Error _emitFailed(
uint32_t err, uint32_t err,
uint32_t instId, uint32_t options, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3) { uint32_t instId, uint32_t options, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3) {

View File

@@ -12,6 +12,8 @@
#if !defined(ASMJIT_DISABLE_LOGGING) #if !defined(ASMJIT_DISABLE_LOGGING)
// [Dependencies] // [Dependencies]
#include "../base/codeholder.h"
#include "../base/codeemitter.h"
#include "../base/logging.h" #include "../base/logging.h"
#include "../base/utils.h" #include "../base/utils.h"
@@ -21,6 +23,8 @@
#if !defined(ASMJIT_DISABLE_COMPILER) #if !defined(ASMJIT_DISABLE_COMPILER)
# include "../base/codecompiler.h" # include "../base/codecompiler.h"
#else
namespace asmjit { class VirtReg; }
#endif // !ASMJIT_DISABLE_COMPILER #endif // !ASMJIT_DISABLE_COMPILER
#if defined(ASMJIT_BUILD_X86) #if defined(ASMJIT_BUILD_X86)
@@ -35,6 +39,7 @@
#include "../asmjit_apibegin.h" #include "../asmjit_apibegin.h"
namespace asmjit { namespace asmjit {
// ============================================================================ // ============================================================================
// [asmjit::Logger - Construction / Destruction] // [asmjit::Logger - Construction / Destruction]
// ============================================================================ // ============================================================================
@@ -323,8 +328,10 @@ static Error formatFuncRets(
if (i) ASMJIT_PROPAGATE(sb.appendString(", ")); if (i) ASMJIT_PROPAGATE(sb.appendString(", "));
ASMJIT_PROPAGATE(formatFuncDetailValue(sb, logOptions, emitter, fd.getRet(i))); ASMJIT_PROPAGATE(formatFuncDetailValue(sb, logOptions, emitter, fd.getRet(i)));
#if !defined(ASMJIT_DISABLE_COMPILER)
if (vRegs) if (vRegs)
ASMJIT_PROPAGATE(sb.appendFormat(" {%s}", vRegs[i]->getName())); ASMJIT_PROPAGATE(sb.appendFormat(" {%s}", vRegs[i]->getName()));
#endif // !ASMJIT_DISABLE_COMPILER
} }
return kErrorOk; return kErrorOk;
@@ -341,8 +348,10 @@ static Error formatFuncArgs(
if (i) ASMJIT_PROPAGATE(sb.appendString(", ")); if (i) ASMJIT_PROPAGATE(sb.appendString(", "));
ASMJIT_PROPAGATE(formatFuncDetailValue(sb, logOptions, emitter, fd.getArg(i))); ASMJIT_PROPAGATE(formatFuncDetailValue(sb, logOptions, emitter, fd.getArg(i)));
#if !defined(ASMJIT_DISABLE_COMPILER)
if (vRegs) if (vRegs)
ASMJIT_PROPAGATE(sb.appendFormat(" {%s}", vRegs[i]->getName())); ASMJIT_PROPAGATE(sb.appendFormat(" {%s}", vRegs[i]->getName()));
#endif // !ASMJIT_DISABLE_COMPILER
} }
return kErrorOk; return kErrorOk;

View File

@@ -536,6 +536,7 @@ ASMJIT_FAVOR_SIZE Error X86Logging::formatRegister(
ASMJIT_UNUSED(archType); ASMJIT_UNUSED(archType);
if (Operand::isPackedId(rId)) { if (Operand::isPackedId(rId)) {
#if !defined(ASMJIT_DISABLE_COMPILER)
if (emitter && emitter->getType() == CodeEmitter::kTypeCompiler) { if (emitter && emitter->getType() == CodeEmitter::kTypeCompiler) {
const CodeCompiler* cc = static_cast<const CodeCompiler*>(emitter); const CodeCompiler* cc = static_cast<const CodeCompiler*>(emitter);
@@ -550,6 +551,7 @@ ASMJIT_FAVOR_SIZE Error X86Logging::formatRegister(
return sb.appendFormat("v%u", static_cast<unsigned int>(Operand::unpackId(rId))); return sb.appendFormat("v%u", static_cast<unsigned int>(Operand::unpackId(rId)));
} }
} }
#endif // !ASMJIT_DISABLE_COMPILER
return sb.appendFormat("VirtReg<Type=%u Id=%u>", rType, rId); return sb.appendFormat("VirtReg<Type=%u Id=%u>", rType, rId);
} }