diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Debugify.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp index 73a3a40..fc42f2c5 100644 --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/llvm/lib/Transforms/Utils/Debugify.cpp @@ -554,16 +554,15 @@ bool diagnoseMisSizedDbgValue(Module &M, DbgValueInst *DVI) { // // TODO: This, along with a check for non-null value operands, should be // promoted to verifier failures. + Value *V = DVI->getValue(); + if (!V) + return false; // For now, don't try to interpret anything more complicated than an empty // DIExpression. Eventually we should try to handle OP_deref and fragments. if (DVI->getExpression()->getNumElements()) return false; - Value *V = DVI->getVariableLocationOp(0); - if (!V) - return false; - Type *Ty = V->getType(); uint64_t ValueOperandSize = getAllocSizeInBits(M, Ty); Optional<uint64_t> DbgVarSize = DVI->getFragmentSizeInBits(); |