@@ -1185,13 +1185,10 @@ static void insertSpills(const FrameDataInfo &FrameData, coro::Shape &Shape) {
11851185 // processed by coro::salvageDebugInfo() by the Cloner. However, convert
11861186 // it to a dbg.declare to make sure future passes don't have to deal
11871187 // with a dbg.coroframe_entry.
1188- auto *VAM = ValueAsMetadata::get (CurrentReload);
1189- Type *Ty = VAM->getValue ()->getType ();
11901188 DbgVariableRecord *NewDVR = new DbgVariableRecord (
11911189 ValueAsMetadata::get (CurrentReload), DDI->getVariable (),
11921190 DDI->getExpression (), DDI->getDebugLoc (),
1193- Ty->isPointerTy () ? DbgVariableRecord::LocationType::Declare
1194- : DbgVariableRecord::LocationType::Value);
1191+ DbgVariableRecord::LocationType::Declare);
11951192 Builder.GetInsertPoint ()->getParent ()->insertDbgRecordBefore (
11961193 NewDVR, Builder.GetInsertPoint ());
11971194 // This dbg.coroframe_entry is for the main function entry point. It
@@ -2063,16 +2060,8 @@ void coro::salvageDebugInfo(
20632060 // If there is a dbg.coroframe_entry being reinserted, insert it as a
20642061 // dbg.declare instead, so that subsequent passes don't have to deal with
20652062 // a dbg.coroframe_entry.
2066- if (DVR.getType () == DbgVariableRecord::LocationType::CoroFrameEntry) {
2067- auto *MD = DVR.getRawLocation ();
2068- if (auto *VAM = dyn_cast<ValueAsMetadata>(MD)) {
2069- Type *Ty = VAM->getValue ()->getType ();
2070- if (Ty->isPointerTy ())
2071- DVR.Type = DbgVariableRecord::LocationType::Declare;
2072- else
2073- DVR.Type = DbgVariableRecord::LocationType::Value;
2074- }
2075- }
2063+ if (DVR.getType () == DbgVariableRecord::LocationType::CoroFrameEntry)
2064+ DVR.Type = DbgVariableRecord::LocationType::Declare;
20762065 (*InsertPt)->getParent ()->insertDbgRecordBefore (&DVR, *InsertPt);
20772066 }
20782067 }
0 commit comments