git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321918
91177308-0d34-0410-b5e6-
96231b3b80d8
; RUN: opt -S -argpromotion < %s | FileCheck %s
; RUN: opt -S -passes=argpromotion < %s | FileCheck %s
+; RUN: opt -S -debugify -o /dev/null < %s
target triple = "x86_64-pc-windows-msvc"
define internal void @callee(i8*) {
// Get a DIType which corresponds to Ty.
DenseMap<uint64_t, DIType *> TypeCache;
auto getCachedDIType = [&](Type *Ty) -> DIType * {
- uint64_t Size = M.getDataLayout().getTypeAllocSizeInBits(Ty);
+ uint64_t Size =
+ Ty->isSized() ? M.getDataLayout().getTypeAllocSizeInBits(Ty) : 0;
DIType *&DTy = TypeCache[Size];
if (!DTy) {
std::string Name = "ty" + utostr(Size);