Skip to content

Commit 6733871

Browse files
Revert "Only pass the descriptor arg to CFI_show()"
This reverts commit 9994293.
1 parent 0984143 commit 6733871

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

flang-rt/lib/runtime/ISO_Fortran_binding.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,11 @@ RT_API_ATTRS int CFI_setpointer(CFI_cdesc_t *result, const CFI_cdesc_t *source,
297297
return CFI_SUCCESS;
298298
}
299299

300-
RT_API_ATTRS void CFI_show(const CFI_cdesc_t *descr) {
300+
RT_API_ATTRS void CFI_show(void *buf, const CFI_cdesc_t *descr) {
301+
FILE *f{stderr};
302+
std::fprintf(f, "%p CFI_desc_t: %p\n", buf, descr);
301303
if (descr) {
302-
reinterpret_cast<const Fortran::runtime::Descriptor *>(descr)->Dump(stderr);
304+
reinterpret_cast<const Fortran::runtime::Descriptor *>(descr)->Dump(f);
303305
}
304306
}
305307

flang/include/flang/ISO_Fortran_binding.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ RT_API_ATTRS int CFI_select_part(CFI_cdesc_t *, const CFI_cdesc_t *source,
208208
size_t displacement, size_t elem_len);
209209
RT_API_ATTRS int CFI_setpointer(
210210
CFI_cdesc_t *, const CFI_cdesc_t *source, const CFI_index_t lower_bounds[]);
211-
RT_API_ATTRS void CFI_show(const CFI_cdesc_t *descr);
211+
RT_API_ATTRS void CFI_show(void *buf, const CFI_cdesc_t *descr);
212212
#ifdef __cplusplus
213213
} // extern "C"
214214
#endif

0 commit comments

Comments
 (0)