[NVPTX] Fix crash with unnamed struct arguments

Patch by Eric Holk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169418 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Holewinski 2012-12-05 20:50:28 +00:00
parent eef7b6219e
commit 2f1086137d
2 changed files with 6 additions and 1 deletions

View File

@ -957,7 +957,7 @@ bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) {
return false;
const StructType *STy = dyn_cast<StructType>(PTy->getElementType());
const std::string TypeName = STy ? STy->getName() : "";
const std::string TypeName = STy && !STy->isLiteral() ? STy->getName() : "";
for (int i = 0, e = array_lengthof(specialTypes); i != e; ++i)
if (TypeName == specialTypes[i])

View File

@ -0,0 +1,5 @@
; RUN: llc < %s -march=nvptx -mcpu=sm_13
define ptx_device void @test_function({i8, i8}*) {
ret void
}