diff --git a/cbackend.cpp b/cbackend.cpp index 40f87074..3db2d504 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -660,7 +660,7 @@ void CWriter::printStructReturnPointerFunctionType(llvm::raw_ostream &Out, llvm::raw_ostream & CWriter::printSimpleType(llvm::raw_ostream &Out, llvm::Type *Ty, bool isSigned, const std::string &NameSoFar) { - assert((Ty->isPrimitiveType() || Ty->isIntegerTy() || Ty->isVectorTy()) && + assert((Ty->isFloatingPointTy() || Ty->isX86_MMXTy() || Ty->isIntegerTy() || Ty->isVectorTy() || Ty->isVoidTy()) && "Invalid type for printSimpleType"); switch (Ty->getTypeID()) { case llvm::Type::VoidTyID: return Out << "void " << NameSoFar; @@ -756,7 +756,7 @@ llvm::raw_ostream &CWriter::printType(llvm::raw_ostream &Out, llvm::Type *Ty, #endif ) { - if (Ty->isPrimitiveType() || Ty->isIntegerTy() || Ty->isVectorTy()) { + if (Ty->isFloatingPointTy() || Ty->isX86_MMXTy() || Ty->isIntegerTy() || Ty->isVectorTy() || Ty->isVoidTy()) { printSimpleType(Out, Ty, isSigned, NameSoFar); return Out; } @@ -2737,7 +2737,7 @@ void CWriter::printModuleTypes() { void CWriter::printContainedStructs(llvm::Type *Ty, llvm::SmallPtrSet &Printed) { // Don't walk through pointers. - if (Ty->isPointerTy() || Ty->isPrimitiveType() || Ty->isIntegerTy()) + if (!(Ty->isStructTy() || Ty->isArrayTy())) return; // Print all contained types first. diff --git a/ispc.cpp b/ispc.cpp index b1790dc3..ed326b14 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -944,7 +944,8 @@ Target::GetISATargetString() const { static bool lGenericTypeLayoutIndeterminate(llvm::Type *type) { - if (type->isPrimitiveType() || type->isIntegerTy()) + if (type->isFloatingPointTy() || type->isX86_MMXTy() || type->isVoidTy() || + type->isIntegerTy() || type->isLabelTy() || type->isMetadataTy()) return false; if (type == LLVMTypes::BoolVectorType ||