DebugInfo: Gut DIExpression

Completely gut `DIExpression`, turning it into a simple wrapper around
`MDExpression *`.  There are two bits of magic left:

  - It's constructed from `const MDExpression*` but convertible to
    `MDExpression*`.
  - It's default-constructed to `nullptr`.

Otherwise, it should behave quite like a raw pointer.  Once I've done
the same to the rest of the `DIDescriptor` subclasses, I'll come back to
delete them entirely (and update call sites as necessary to deal with
the missing magic).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234832 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-14 01:12:42 +00:00
parent d48d32bba9
commit 15552c46a0
8 changed files with 40 additions and 50 deletions

View File

@@ -76,7 +76,7 @@ public:
MachineLocation getLoc() const { return Loc; }
const MDNode *getVariableNode() const { return Variable; }
DIVariable getVariable() const { return cast<MDLocalVariable>(Variable); }
bool isBitPiece() const { return getExpression().isBitPiece(); }
bool isBitPiece() const { return getExpression()->isBitPiece(); }
DIExpression getExpression() const {
return cast_or_null<MDExpression>(Expression);
}
@@ -108,8 +108,7 @@ public:
DIExpression NextExpr =
cast_or_null<MDExpression>(Next.Values[0].Expression);
DIVariable NextVar = cast_or_null<MDLocalVariable>(Next.Values[0].Variable);
if (Var == NextVar && Expr.isBitPiece() &&
NextExpr.isBitPiece()) {
if (Var == NextVar && Expr->isBitPiece() && NextExpr->isBitPiece()) {
addValues(Next.Values);
End = Next.End;
return true;
@@ -192,8 +191,8 @@ inline bool operator==(const DebugLocEntry::Value &A,
/// \brief Compare two pieces based on their offset.
inline bool operator<(const DebugLocEntry::Value &A,
const DebugLocEntry::Value &B) {
return A.getExpression().getBitPieceOffset() <
B.getExpression().getBitPieceOffset();
return A.getExpression()->getBitPieceOffset() <
B.getExpression()->getBitPieceOffset();
}
}