Refactor the DIExpression fragment query interface (NFC)
... so it becomes available to DIExpressionCursor.
llvm-svn: 290322
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 3d0ae1a..8dde4a1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -944,9 +944,10 @@
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.
}