summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 6de0f34e94c..6e4174aa0cd 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1112,9 +1112,10 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
unsigned FragmentOffset = 0;
// If this already is a bit fragment, we drop the bit fragment from the
// expression and record the offset.
- if (DIExpr->isFragment()) {
+ auto Fragment = DIExpr->getFragmentInfo();
+ if (Fragment) {
Ops.append(DIExpr->elements_begin(), DIExpr->elements_end()-3);
- FragmentOffset = DIExpr->getFragmentOffsetInBits();
+ FragmentOffset = Fragment->OffsetInBits;
} else {
Ops.append(DIExpr->elements_begin(), DIExpr->elements_end());
}
OpenPOWER on IntegriCloud