diff options
| author | stozer <stephen.tozer@sony.com> | 2019-11-22 16:40:32 +0000 |
|---|---|---|
| committer | stozer <stephen.tozer@sony.com> | 2019-11-26 16:12:22 +0000 |
| commit | 184d72a7c6a7f40e752a044eb0336cbd4c43d004 (patch) | |
| tree | 93c73b8031eb66e96a7f2bea9b57b225961c623e /llvm/lib/IR | |
| parent | 7707d8aa9db8aa3814593f9c40cc707f306e3ae2 (diff) | |
| download | bcm5719-llvm-184d72a7c6a7f40e752a044eb0336cbd4c43d004.tar.gz bcm5719-llvm-184d72a7c6a7f40e752a044eb0336cbd4c43d004.zip | |
[DebugInfo] Disallow fragmenting DIExpressions with shift operators
DIExpressions with shift operators should not be fragmented for the same
reason as arithmetic operators: carry over cannot be expressed from one
fragment to the other, so an invalid result would be produced.
Differential Revision: https://reviews.llvm.org/D70601
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index e4036ee1eb0..b0102275b36 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -1148,10 +1148,14 @@ Optional<DIExpression *> DIExpression::createFragmentExpression( for (auto Op : Expr->expr_ops()) { switch (Op.getOp()) { default: break; + case dwarf::DW_OP_shr: + case dwarf::DW_OP_shra: + case dwarf::DW_OP_shl: case dwarf::DW_OP_plus: + case dwarf::DW_OP_plus_uconst: case dwarf::DW_OP_minus: - // We can't safely split arithmetic into multiple fragments because we - // can't express carry-over between fragments. + // We can't safely split arithmetic or shift operations into multiple + // fragments because we can't express carry-over between fragments. // // FIXME: We *could* preserve the lowest fragment of a constant offset // operation if the offset fits into SizeInBits. |

