@@ -2230,6 +2230,8 @@ template <typename T> static void salvageDbgAssignAddress(T *Assign) {
2230
2230
assert (!SalvagedExpr->getFragmentInfo ().has_value () &&
2231
2231
" address-expression shouldn't have fragment info" );
2232
2232
2233
+ SalvagedExpr = SalvagedExpr->foldConstantMath ();
2234
+
2233
2235
// Salvage succeeds if no additional values are required.
2234
2236
if (AdditionalValues.empty ()) {
2235
2237
Assign->setAddress (NewV);
@@ -2285,6 +2287,7 @@ void llvm::salvageDebugInfoForDbgValues(
2285
2287
DIExpression::appendOpsToArg (SalvagedExpr, Ops, LocNo, StackValue);
2286
2288
LocItr = std::find (++LocItr, DIILocation.end (), &I);
2287
2289
}
2290
+ SalvagedExpr = SalvagedExpr->foldConstantMath ();
2288
2291
// salvageDebugInfoImpl should fail on examining the first element of
2289
2292
// DbgUsers, or none of them.
2290
2293
if (!Op0)
@@ -2346,6 +2349,7 @@ void llvm::salvageDebugInfoForDbgValues(
2346
2349
DIExpression::appendOpsToArg (SalvagedExpr, Ops, LocNo, StackValue);
2347
2350
LocItr = std::find (++LocItr, DVRLocation.end (), &I);
2348
2351
}
2352
+ SalvagedExpr = SalvagedExpr->foldConstantMath ();
2349
2353
// salvageDebugInfoImpl should fail on examining the first element of
2350
2354
// DbgUsers, or none of them.
2351
2355
if (!Op0)
0 commit comments