[NVPTX] Fix crash with unnamed struct arguments

Patch by Eric Holk

llvm-svn: 169418
This commit is contained in:
Justin Holewinski 2012-12-05 20:50:28 +00:00
parent 90b0c84bcf
commit fb711156ae
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
}