Skip to content

Commit 885e8d8

Browse files
committed
address review comments
1 parent 49f1092 commit 885e8d8

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

flang-rt/include/flang-rt/runtime/descriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ class Descriptor {
511511
RT_API_ATTRS void Check() const;
512512

513513
// When dumpRawType, dumps stringified CFI_type_*, otherwise
514-
// try to canonicalize and pront as a Fortran type.
514+
// try to canonicalize and print as a Fortran type.
515515
void Dump(FILE * = stdout, bool dumpRawType = true) const;
516516

517517
RT_API_ATTRS inline bool HasAddendum() const {

flang-rt/lib/runtime/extensions.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,9 @@ std::int64_t RTNAME(time)() { return time(nullptr); }
398398
// MCLOCK: returns accumulated CPU time in ticks
399399
std::int32_t FORTRAN_PROCEDURE_NAME(mclock)() { return std::clock(); }
400400

401-
void RTNAME(ShowDescriptor)(const char *descr) {
401+
void RTNAME(ShowDescriptor)(const Fortran::runtime::Descriptor *descr) {
402402
if (descr) {
403-
reinterpret_cast<const Fortran::runtime::Descriptor *>(descr)->Dump(
404-
stderr, /*dumpRawType=*/false);
403+
descr->Dump(stderr, /*dumpRawType=*/false);
405404
} else {
406405
std::fprintf(stderr, "NULL\n");
407406
}

flang/include/flang/Runtime/extensions.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ typedef std::uint32_t gid_t;
2525
#else
2626
#include "sys/types.h" //pid_t
2727
#endif
28+
namespace Fortran {
29+
namespace runtime {
30+
class Descriptor;
31+
}
32+
} // namespace Fortran
2833

2934
extern "C" {
3035

@@ -102,7 +107,7 @@ float FORTRAN_PROCEDURE_NAME(secnds)(float *refTime);
102107
float RTNAME(Secnds)(float *refTime, const char *sourceFile, int line);
103108

104109
// Extension subroutine SHOW_DESCRIPTOR(D)
105-
void RTNAME(ShowDescriptor)(const char *descr);
110+
void RTNAME(ShowDescriptor)(const Fortran::runtime::Descriptor* descr);
106111

107112
} // extern "C"
108113
#endif // FORTRAN_RUNTIME_EXTENSIONS_H_

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7820,7 +7820,7 @@ mlir::Value IntrinsicLibrary::genShiftA(mlir::Type resultType,
78207820

78217821
void IntrinsicLibrary::genShowDescriptor(
78227822
llvm::ArrayRef<fir::ExtendedValue> args) {
7823-
assert(args.size() == 1);
7823+
assert(args.size() == 1 && "expected single argument for show_descriptor");
78247824
const mlir::Value descriptor = fir::getBase(args[0]);
78257825

78267826
assert(fir::isa_box_type(descriptor.getType()) &&

0 commit comments

Comments
 (0)