summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp7
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp5
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp10
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp2
6 files changed, 22 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 7adac4cbf94..f0537e04165 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -713,9 +713,10 @@ static bool emitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
OS << V->getName();
const DIExpression *Expr = MI->getDebugExpression();
- if (Expr->isFragment())
- OS << " [fragment offset=" << Expr->getFragmentOffsetInBits()
- << " size=" << Expr->getFragmentSizeInBits() << "]";
+ auto Fragment = Expr->getFragmentInfo();
+ if (Fragment)
+ OS << " [fragment offset=" << Fragment->OffsetInBits
+ << " size=" << Fragment->SizeInBits << "]";
OS << " <- ";
// The second operand is only an offset if it's an immediate.
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 3d0ae1a9399..8dde4a1031b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -944,9 +944,10 @@ void CodeViewDebug::collectVariableInfo(const DISubprogram *SP) {
unsigned StructOffset = 0;
// Handle fragments.
- if (DIExpr && DIExpr->isFragment()) {
+ auto Fragment = DIExpr->getFragmentInfo();
+ if (DIExpr && Fragment) {
IsSubfield = true;
- StructOffset = DIExpr->getFragmentOffsetInBits() / 8;
+ StructOffset = Fragment->OffsetInBits / 8;
} else if (DIExpr && DIExpr->getNumElements() > 0) {
continue; // Ignore unrecognized exprs.
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index aa71449b2c0..94190981e88 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -65,10 +65,12 @@ MCSymbol *DebugHandlerBase::getLabelAfterInsn(const MachineInstr *MI) {
int DebugHandlerBase::fragmentCmp(const DIExpression *P1,
const DIExpression *P2) {
- unsigned l1 = P1->getFragmentOffsetInBits();
- unsigned l2 = P2->getFragmentOffsetInBits();
- unsigned r1 = l1 + P1->getFragmentSizeInBits();
- unsigned r2 = l2 + P2->getFragmentSizeInBits();
+ auto Fragment1 = *P1->getFragmentInfo();
+ auto Fragment2 = *P2->getFragmentInfo();
+ unsigned l1 = Fragment1.OffsetInBits;
+ unsigned l2 = Fragment2.OffsetInBits;
+ unsigned r1 = l1 + Fragment1.SizeInBits;
+ unsigned r2 = l2 + Fragment2.SizeInBits;
if (r1 <= l2)
return -1;
else if (r2 <= l1)
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
index 9444fad048f..36fb1507ddc 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
@@ -175,8 +175,8 @@ inline bool operator==(const DebugLocEntry::Value &A,
/// Compare two fragments based on their offset.
inline bool operator<(const DebugLocEntry::Value &A,
const DebugLocEntry::Value &B) {
- return A.getExpression()->getFragmentOffsetInBits() <
- B.getExpression()->getFragmentOffsetInBits();
+ return A.getExpression()->getFragmentInfo()->OffsetInBits <
+ B.getExpression()->getFragmentInfo()->OffsetInBits;
}
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 45d6e38aea7..b465b98f368 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -469,10 +469,12 @@ static SmallVectorImpl<DwarfCompileUnit::GlobalExpr> &
sortGlobalExprs(SmallVectorImpl<DwarfCompileUnit::GlobalExpr> &GVEs) {
std::sort(GVEs.begin(), GVEs.end(),
[](DwarfCompileUnit::GlobalExpr A, DwarfCompileUnit::GlobalExpr B) {
- if (A.Expr != B.Expr && A.Expr && B.Expr &&
- A.Expr->isFragment() && B.Expr->isFragment())
- return A.Expr->getFragmentOffsetInBits() <
- B.Expr->getFragmentOffsetInBits();
+ if (A.Expr != B.Expr && A.Expr && B.Expr) {
+ auto FragmentA = A.Expr->getFragmentInfo();
+ auto FragmentB = B.Expr->getFragmentInfo();
+ if (FragmentA && FragmentB)
+ return FragmentA->OffsetInBits < FragmentB->OffsetInBits;
+ }
return false;
});
GVEs.erase(std::unique(GVEs.begin(), GVEs.end(),
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
index a17776f2ce9..5419a10f4f9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
@@ -285,7 +285,7 @@ void DwarfExpression::addFragmentOffset(const DIExpression *Expr) {
if (!Expr || !Expr->isFragment())
return;
- uint64_t FragmentOffset = Expr->getFragmentOffsetInBits();
+ uint64_t FragmentOffset = Expr->getFragmentInfo()->OffsetInBits;
assert(FragmentOffset >= OffsetInBits &&
"overlapping or duplicate fragments");
if (FragmentOffset > OffsetInBits)
OpenPOWER on IntegriCloud