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 | f9b41cd3d8437652b2d08504b5ab3eb671df1bb7 (patch) | |
tree | 10e95dcc0c93a22b0f1ba70b7c8364dd883baac6 /llvm/lib/IR/DebugInfoMetadata.cpp | |
parent | 33562c2dcc208ce8dca7a51900a856be9cf70f0b (diff) | |
download | bcm5719-llvm-f9b41cd3d8437652b2d08504b5ab3eb671df1bb7.tar.gz bcm5719-llvm-f9b41cd3d8437652b2d08504b5ab3eb671df1bb7.zip |
[DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
Differential Revision: https://reviews.llvm.org/D29672
llvm-svn: 297247
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 3fe2872183d..54cc52f0626 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/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; } } |