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
+4 -4
View File
@@ -4191,14 +4191,14 @@ bool SROA::splitAlloca(AllocaInst &AI, AllocaSlices &AS) {
// Create a piece expression describing the new partition or reuse AI's
// expression if there is only one partition.
DIExpression PieceExpr = Expr;
if (IsSplit || Expr.isBitPiece()) {
if (IsSplit || Expr->isBitPiece()) {
// If this alloca is already a scalar replacement of a larger aggregate,
// Piece.Offset describes the offset inside the scalar.
uint64_t Offset = Expr.isBitPiece() ? Expr.getBitPieceOffset() : 0;
uint64_t Offset = Expr->isBitPiece() ? Expr->getBitPieceOffset() : 0;
uint64_t Start = Offset + Piece.Offset;
uint64_t Size = Piece.Size;
if (Expr.isBitPiece()) {
uint64_t AbsEnd = Expr.getBitPieceOffset() + Expr.getBitPieceSize();
if (Expr->isBitPiece()) {
uint64_t AbsEnd = Expr->getBitPieceOffset() + Expr->getBitPieceSize();
if (Start >= AbsEnd)
// No need to describe a SROAed padding.
continue;