From 382b40b0e08de77b6173044e2e56439ac1b31068 Mon Sep 17 00:00:00 2001 From: Benjamin Segovia Date: Fri, 9 Nov 2012 00:52:47 -0800 Subject: [PATCH] Fixed inverted assertion --- backend/src/llvm/llvm_gen_backend.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index cc00655..179a41e 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -120,7 +120,7 @@ #define LLVM_VERSION_MINOR 0 #endif /* !defined(LLVM_VERSION_MINOR) */ -#if (LLVM_VERSION_MAJOR != 3) || (LLVM_VERSION_MINOR >= 2) +#if (LLVM_VERSION_MAJOR != 3) || (LLVM_VERSION_MINOR > 2) #error "Only LLVM 3.0 / 3.1 is supported" #endif /* (LLVM_VERSION_MAJOR != 3) && (LLVM_VERSION_MINOR >= 2) */ @@ -525,13 +525,11 @@ namespace gbe template static U processConstant(Constant *CPV, T doIt, uint32_t index = 0u) { - if (dyn_cast(CPV)) - GBE_ASSERTM(false, "Unsupported constant expression"); - else if (isa(CPV) && CPV->getType()->isSingleValueType()) +#if GBE_DEBUG + GBE_ASSERTM(dyn_cast(CPV) == NULL, "Unsupported constant expression"); + if (isa(CPV) && CPV->getType()->isSingleValueType()) GBE_ASSERTM(false, "Unsupported constant expression"); - - GBE_ASSERTM(dyn_cast(CPV), - "Constant expressions are not supported yet"); +#endif /* GBE_DEBUG */ #if LLVM_VERSION_MINOR > 0 ConstantDataSequential *seq = dyn_cast(CPV); @@ -568,6 +566,7 @@ namespace gbe } else { if (dyn_cast(CPV)) CPV = extractConstantElem(CPV, index); + GBE_ASSERTM(dyn_cast(CPV) == NULL, "Unsupported constant expression"); // Integers if (ConstantInt *CI = dyn_cast(CPV)) { -- 2.7.4