Skip to content

Commit 761f4ef

Browse files
Revert "Convert #dbg_coroframe_entry to #dbg_value if location is not a pointer."
This reverts commit 9732744.
1 parent a26095f commit 761f4ef

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)