Skip to content

Commit da76073

Browse files
committed
[RemoveDIs][DebugInfo] Explicitly convert iterator to pointer for std::distance
This is a small patch attempting to fix an error with a prior patch which caused buildbot failures on certain targets; for example: https://lab.llvm.org/buildbot/#/builders/127/builds/60931 The compile error comes from std::distance not having an overload for a std::array iterator and a raw pointer; this patch converts the iterator to a pointer to resolve this. Fixes d499df0
1 parent 9e068cd commit da76073

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/IR/Metadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void DebugValueUser::handleChangedValue(void *Old, Metadata *New) {
157157
// NOTE: We could inform the "owner" that a value has changed through
158158
// getOwner, if needed.
159159
auto OldMD = static_cast<Metadata **>(Old);
160-
ptrdiff_t Idx = std::distance(DebugValues.begin(), OldMD);
160+
ptrdiff_t Idx = std::distance(&*DebugValues.begin(), OldMD);
161161
resetDebugValue(Idx, New);
162162
}
163163

0 commit comments

Comments
 (0)