Disable error message output in release version.
authorRuiling Song <ruiling.song@intel.com>
Tue, 2 Jul 2013 08:44:43 +0000 (16:44 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 3 Jul 2013 10:20:16 +0000 (18:20 +0800)
As piglit will got the error message we output to stderr and mark the case 'WARN'.
so, we disable the message to stderr, and use release version to run piglit.

also fix a minor compile fail under release version.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Yang, Rong R <rong.r.yang@intel.com>
backend/src/llvm/llvm_gen_backend.cpp
src/cl_utils.h

index db34296..c2e37fa 100644 (file)
@@ -1824,10 +1824,9 @@ namespace gbe
 
   void GenWriter::emitAtomicInst(CallInst &I, CallSite &CS, ir::AtomicOps opcode) {
     CallSite::arg_iterator AI = CS.arg_begin();
-#if GBE_DEBUG
     CallSite::arg_iterator AE = CS.arg_end();
-#endif /* GBE_DEBUG */
     GBE_ASSERT(AI != AE);
+
     unsigned int llvmSpace = (*AI)->getType()->getPointerAddressSpace();
     const ir::AddressSpace addrSpace = addressSpaceLLVMToGen(llvmSpace);
     const ir::Register dst = this->getRegister(&I);
index dfb1369..59b7a2b 100644 (file)
@@ -39,14 +39,22 @@ struct JOIN(__,JOIN(__,__LINE__)) {                                 \
 }
 
 /* Throw errors */
-#define ERR(ERROR, ...)                                             \
-do {                                                                \
-  fprintf(stderr, "error in %s line %i\n", __FILE__, __LINE__);     \
-  fprintf(stderr, __VA_ARGS__);                                     \
-  fprintf(stderr, "\n");                                            \
-  err = ERROR;                                                      \
-  goto error;                                                       \
-} while (0)
+#ifdef NDEBUG
+  #define ERR(ERROR, ...)                                             \
+  do {                                                                \
+    err = ERROR;                                                      \
+    goto error;                                                       \
+  } while (0)
+#else
+  #define ERR(ERROR, ...)                                             \
+  do {                                                                \
+    fprintf(stderr, "error in %s line %i\n", __FILE__, __LINE__);     \
+    fprintf(stderr, __VA_ARGS__);                                     \
+    fprintf(stderr, "\n");                                            \
+    err = ERROR;                                                      \
+    goto error;                                                       \
+  } while (0)
+#endif
 
 #define DO_ALLOC_ERR                                                \
 do {                                                                \