diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-02-09 23:57:15 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-02-09 23:57:15 +0000 |
commit | 27bd01f71cbc9ef5c489e27980b21087232b229c (patch) | |
tree | ebff33b7a1a66482dece6d63656820d095522330 /llvm/lib/IR/DebugInfo.cpp | |
parent | 328b1633d79a61db739a366b1f58cee42e307240 (diff) | |
download | bcm5719-llvm-27bd01f71cbc9ef5c489e27980b21087232b229c.tar.gz bcm5719-llvm-27bd01f71cbc9ef5c489e27980b21087232b229c.zip |
Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the
intermediate representation. This
- increases consistency by using the same granularity everywhere
- allows for pieces < 1 byte
- DW_OP_piece didn't actually allow storing an offset.
Part of PR22495.
llvm-svn: 228631
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index ad661c5c435..31f1e19a945 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -147,18 +147,18 @@ uint64_t DIExpression::getElement(unsigned Idx) const { return getHeaderFieldAs<int64_t>(I); } -bool DIExpression::isVariablePiece() const { +bool DIExpression::isBitPiece() const { unsigned N = getNumElements(); - return N >=3 && getElement(N-3) == dwarf::DW_OP_piece; + return N >=3 && getElement(N-3) == dwarf::DW_OP_bit_piece; } -uint64_t DIExpression::getPieceOffset() const { - assert(isVariablePiece() && "not a piece"); +uint64_t DIExpression::getBitPieceOffset() const { + assert(isBitPiece() && "not a piece"); return getElement(getNumElements()-2); } -uint64_t DIExpression::getPieceSize() const { - assert(isVariablePiece() && "not a piece"); +uint64_t DIExpression::getBitPieceSize() const { + assert(isBitPiece() && "not a piece"); return getElement(getNumElements()-1); } @@ -612,7 +612,7 @@ bool DIExpression::Verify() const { for (auto Op : *this) switch (Op) { - case DW_OP_piece: + case DW_OP_bit_piece: // Must be the last element of the expression. return std::distance(Op.getBase(), DIHeaderFieldIterator()) == 3; case DW_OP_plus: @@ -1417,7 +1417,7 @@ void DIExpression::printInternal(raw_ostream &OS) const { OS << " " << Op.getArg(1); break; } - case DW_OP_piece: { + case DW_OP_bit_piece: { OS << " offset=" << Op.getArg(1) << ", size=" << Op.getArg(2); break; } |