mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user