[Beignet] [PATCH] GBE: Fix a warning in getConstantPointerRegister.

Ruiling Song ruiling.song at intel.com
Sun Aug 10 19:15:14 PDT 2014


compiler complains "warning: control reaches end of non-void function"

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/llvm/llvm_gen_backend.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index b0571a4..169d589 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -1090,8 +1090,10 @@ namespace gbe
       ctx.ADD(ir::Type::TYPE_S32, reg, pointer_reg, offset_reg);
       return reg;
     }
-    else
-      assert(0);
+    else {
+      GBE_ASSERT(0 && "Unsupported constant expression");
+      return regTranslator.getScalar(val, elemID);
+    }
   }
 
   ir::Register GenWriter::getConstantRegister(Constant *c, uint32_t elemID) {
-- 
1.7.10.4



More information about the Beignet mailing list