summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-07-06 17:32:40 +0000
committerVedant Kumar <vsk@apple.com>2018-07-06 17:32:40 +0000
commitba0c87659742d6be9259c19e9b0dc6c45d57af73 (patch)
tree3d176b02a0eb1f8c563cf71bef70b9044953d306 /llvm/tools/opt
parent6379a62250cc49a9eb6f7a403eb868c08478bc87 (diff)
downloadbcm5719-llvm-ba0c87659742d6be9259c19e9b0dc6c45d57af73.tar.gz
bcm5719-llvm-ba0c87659742d6be9259c19e9b0dc6c45d57af73.zip
[Debugify] Allow unsigned values narrower than their variables
Suppress the diagnostic for mis-sized dbg.values when a value operand is narrower than the unsigned variable it describes. Assume that a debugger would implicitly zero-extend these values. llvm-svn: 336452
Diffstat (limited to 'llvm/tools/opt')
-rw-r--r--llvm/tools/opt/Debugify.cpp11
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 << ": ";
OpenPOWER on IntegriCloud