From 47adba6564b73d85c1ea88cb753a1ee92ab4a518 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Tue, 25 Apr 2017 13:26:33 +0800 Subject: Backend: Fix llvm40 assert about literal structs In llvm literal structs have no name, so check it first. Signed-off-by: Pan Xiuli Reviewed-by: Guo, Yejun --- backend/src/llvm/llvm_gen_backend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index 9954021d..831666ed 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -362,7 +362,8 @@ namespace gbe Type *eltTy = dyn_cast(type)->getElementType(); if (eltTy->isStructTy()) { StructType *strTy = dyn_cast(eltTy); - if (strTy->getName().data() && strstr(strTy->getName().data(), "sampler")) + if (!strTy->isLiteral() && strTy->getName().data() && + strstr(strTy->getName().data(), "sampler")) type = Type::getInt32Ty(value->getContext()); } } -- cgit v1.2.3