Skip to content

Commit a458f6c

Browse files
[flang] Implement CFI_show()
Implement in runtime and add declaration to ISO_Fortran_binding.h
1 parent a684610 commit a458f6c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

flang-rt/lib/runtime/ISO_Fortran_binding.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ 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(void *buf, const CFI_cdesc_t *descr) {
301+
FILE *f{stderr};
302+
std::fprintf(f, "%p CFI_desc_t: %p\n", buf, descr);
303+
if (descr) {
304+
reinterpret_cast<const Fortran::runtime::Descriptor *>(descr)->Dump(f);
305+
}
306+
}
307+
300308
RT_EXT_API_GROUP_END
301309
} // extern "C"
302310
} // namespace Fortran::ISO

flang/include/flang/ISO_Fortran_binding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +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(void *buf, const CFI_cdesc_t *descr);
211212
#ifdef __cplusplus
212213
} // extern "C"
213214
#endif

0 commit comments

Comments
 (0)