diff options
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index 86c819a..246f6b4 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -79,6 +79,8 @@ bool TargetMachine::isLargeGlobalObject(const GlobalObject *GO) const { if (getCodeModel() == CodeModel::Medium || getCodeModel() == CodeModel::Large) { + if (!GV->getValueType()->isSized()) + return true; const DataLayout &DL = GV->getParent()->getDataLayout(); uint64_t Size = DL.getTypeSizeInBits(GV->getValueType()) / 8; return Size == 0 || Size > LargeDataThreshold; |