diff options
author | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-03-17 15:04:27 +0000 |
---|---|---|
committer | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-03-17 16:45:25 +0000 |
commit | 3bfddc25931d44da9b26c092f4e15634712b1459 (patch) | |
tree | 1d46df6ec764c22fd1b16915b688ec105050ec42 /llvm/lib/Transforms/Utils/Debugify.cpp | |
parent | 410f09af09b9261f51663773bee01ec7b37e8fd4 (diff) | |
download | llvm-3bfddc25931d44da9b26c092f4e15634712b1459.zip llvm-3bfddc25931d44da9b26c092f4e15634712b1459.tar.gz llvm-3bfddc25931d44da9b26c092f4e15634712b1459.tar.bz2 |
Reapply "[DebugInfo] Handle multiple variable location operands in IR"
Fixed section of code that iterated through a SmallDenseMap and added
instructions in each iteration, causing non-deterministic code; replaced
SmallDenseMap with MapVector to prevent non-determinism.
This reverts commit 01ac6d1587e8613ba4278786e8341f8b492ac941.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Debugify.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp index fc42f2c5..73a3a40 100644 --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/llvm/lib/Transforms/Utils/Debugify.cpp @@ -554,15 +554,16 @@ 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(); |