summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp31
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h7
2 files changed, 3 insertions, 35 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
index caf0bc0f258..43c98442d8b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
@@ -66,12 +66,6 @@ void DwarfExpression::AddShr(unsigned ShiftBy) {
EmitOp(dwarf::DW_OP_shr);
}
-void DwarfExpression::AddAnd(unsigned Mask) {
- EmitOp(dwarf::DW_OP_constu);
- EmitUnsigned(Mask);
- EmitOp(dwarf::DW_OP_and);
-}
-
bool DwarfExpression::AddMachineRegIndirect(const TargetRegisterInfo &TRI,
unsigned MachineReg, int Offset) {
if (isFrameRegister(TRI, MachineReg)) {
@@ -236,12 +230,6 @@ void DwarfExpression::AddExpression(DIExpressionCursor &&ExprCursor,
unsigned FragmentOffsetInBits) {
while (ExprCursor) {
auto Op = ExprCursor.take();
-
- // If we need to mask out a subregister, do it now, unless the next
- // operation would emit an OpPiece anyway.
- if (SubRegisterSizeInBits && Op->getOp() != dwarf::DW_OP_LLVM_fragment)
- maskSubRegister();
-
switch (Op->getOp()) {
case dwarf::DW_OP_LLVM_fragment: {
unsigned SizeInBits = Op->getArg(1);
@@ -297,24 +285,9 @@ void DwarfExpression::AddExpression(DIExpressionCursor &&ExprCursor,
}
}
-/// Add masking operations to stencil out a subregister.
-void DwarfExpression::maskSubRegister() {
- assert(SubRegisterSizeInBits && "no subregister was registered");
- if (SubRegisterOffsetInBits > 0)
- AddShr(SubRegisterOffsetInBits);
- uint64_t Mask = (1UL << SubRegisterSizeInBits) - 1;
- AddAnd(Mask);
-}
-
-
void DwarfExpression::finalize() {
- // Emit any outstanding DW_OP_piece operations to mask out subregisters.
- if (SubRegisterSizeInBits == 0)
- return;
- // Don't emit a DW_OP_piece for a subregister at offset 0.
- if (SubRegisterOffsetInBits == 0)
- return;
- AddOpPiece(SubRegisterSizeInBits, SubRegisterOffsetInBits);
+ if (SubRegisterSizeInBits)
+ AddOpPiece(SubRegisterSizeInBits, SubRegisterOffsetInBits);
}
void DwarfExpression::addFragmentOffset(const DIExpression *Expr) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
index 2f5a701499d..01f66fa7eac 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h
@@ -99,9 +99,6 @@ protected:
SubRegisterOffsetInBits = OffsetInBits;
}
- /// Add masking operations to stencil out a subregister.
- void maskSubRegister();
-
public:
DwarfExpression(unsigned DwarfVersion) : DwarfVersion(DwarfVersion) {}
virtual ~DwarfExpression() {};
@@ -129,10 +126,8 @@ public:
/// is at the top of the DWARF stack.
void AddOpPiece(unsigned SizeInBits, unsigned OffsetInBits = 0);
- /// Emit a shift-right dwarf operation.
+ /// Emit a shift-right dwarf expression.
void AddShr(unsigned ShiftBy);
- /// Emit a bitwise and dwarf operation.
- void AddAnd(unsigned Mask);
/// Emit a DW_OP_stack_value, if supported.
///
OpenPOWER on IntegriCloud