diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/opt/Debugify.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/tools/opt/Debugify.cpp b/llvm/tools/opt/Debugify.cpp index 05ade96a80d..515f423868d 100644 --- a/llvm/tools/opt/Debugify.cpp +++ b/llvm/tools/opt/Debugify.cpp @@ -188,8 +188,15 @@ bool diagnoseMisSizedDbgValue(Module &M, DbgValueInst *DVI) { if (!ValueOperandSize || !DbgVarSize) return false; - bool HasBadSize = Ty->isIntegerTy() ? (ValueOperandSize < *DbgVarSize) - : (ValueOperandSize != *DbgVarSize); + bool HasBadSize = false; + if (Ty->isIntegerTy()) { + auto Signedness = DVI->getVariable()->getSignedness(); + if (Signedness && *Signedness == DIBasicType::Signedness::Signed) + HasBadSize = ValueOperandSize < *DbgVarSize; + } else { + HasBadSize = ValueOperandSize != *DbgVarSize; + } + if (HasBadSize) { dbg() << "ERROR: dbg.value operand has size " << ValueOperandSize << ", but its variable has size " << *DbgVarSize << ": "; |