diff options
| author | Vedant Kumar <vsk@apple.com> | 2018-01-06 00:37:01 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2018-01-06 00:37:01 +0000 |
| commit | 1f6f5f1df9a67327b7dc968a600a8e5e3a082611 (patch) | |
| tree | 13885b107ec2240387d79c9e3a09a50bc56b8577 /llvm/tools/opt/Debugify.cpp | |
| parent | 24910765e266a4344fa2993a2c5f3fdd9bfb19eb (diff) | |
| download | bcm5719-llvm-1f6f5f1df9a67327b7dc968a600a8e5e3a082611.tar.gz bcm5719-llvm-1f6f5f1df9a67327b7dc968a600a8e5e3a082611.zip | |
[Debugify] Handled unsized types
llvm-svn: 321918
Diffstat (limited to 'llvm/tools/opt/Debugify.cpp')
| -rw-r--r-- | llvm/tools/opt/Debugify.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/opt/Debugify.cpp b/llvm/tools/opt/Debugify.cpp index 40ee545c098..89e572474bd 100644 --- a/llvm/tools/opt/Debugify.cpp +++ b/llvm/tools/opt/Debugify.cpp @@ -47,7 +47,8 @@ bool applyDebugifyMetadata(Module &M) { // 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); |

