diff options
author | Konstantin Zhuravlyov <kzhuravl_dev@outlook.com> | 2017-03-08 00:28:57 +0000 |
---|---|---|
committer | Konstantin Zhuravlyov <kzhuravl_dev@outlook.com> | 2017-03-08 00:28:57 +0000 |
commit | df032da7f1a1df65433f504223f4c4cf7a620332 (patch) | |
tree | da2cb8ef43e5775815f7a552fd85b0f52a47ca6c /lib/IR/DebugInfoMetadata.cpp | |
parent | 50ccd80b5846734f3623e04dc225fc21769166e0 (diff) |
[DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
Differential Revision: https://reviews.llvm.org/D29672
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DebugInfoMetadata.cpp')
-rw-r--r-- | lib/IR/DebugInfoMetadata.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/IR/DebugInfoMetadata.cpp b/lib/IR/DebugInfoMetadata.cpp index 3fe2872183d..54cc52f0626 100644 --- a/lib/IR/DebugInfoMetadata.cpp +++ b/lib/IR/DebugInfoMetadata.cpp @@ -612,10 +612,23 @@ bool DIExpression::isValid() const { return false; break; } + case dwarf::DW_OP_swap: { + // Must be more than one implicit element on the stack. + + // FIXME: A better way to implement this would be to add a local variable + // that keeps track of the stack depth and introduce something like a + // DW_LLVM_OP_implicit_location as a placeholder for the location this + // DIExpression is attached to, or else pass the number of implicit stack + // elements into isValid. + if (getNumElements() == 1) + return false; + break; + } case dwarf::DW_OP_constu: case dwarf::DW_OP_plus: case dwarf::DW_OP_minus: case dwarf::DW_OP_deref: + case dwarf::DW_OP_xderef: break; } } |