diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2017-04-25 13:26:33 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2017-05-18 16:47:45 +0800 |
commit | 47adba6564b73d85c1ea88cb753a1ee92ab4a518 (patch) | |
tree | 2b745dbab58a729a429bc086eb1b6424ed788366 | |
parent | 448f8f7a2a2901aa8807a212760539889bc3ebb8 (diff) |
Backend: Fix llvm40 assert about literal structs
In llvm literal structs have no name, so check it first.
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Guo, Yejun <yejun.guo@intel.com>
-rw-r--r-- | backend/src/llvm/llvm_gen_backend.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<PointerType>(type)->getElementType(); if (eltTy->isStructTy()) { StructType *strTy = dyn_cast<StructType>(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()); } } |