[flang] Fix broken build of flang with clang

A recent commit (e00a170) inadvertently exposed the Reshape runtime
function as being extern "C", for which it is not yet ready, leading
to a valid warning from clang that we treat as an error.  Patch.
This commit is contained in:
peter klausler 2021-05-20 13:49:31 -07:00
parent c1db35f0c2
commit 854367240d
2 changed files with 9 additions and 6 deletions

View File

@ -351,6 +351,7 @@ void RTNAME(Pack)(Descriptor &result, const Descriptor &source,
}
}
} // extern "C" - TODO put Reshape under extern "C"
// F2018 16.9.163
OwningPtr<Descriptor> RTNAME(Reshape)(const Descriptor &source,
const Descriptor &shape, const Descriptor *pad, const Descriptor *order,
@ -464,6 +465,7 @@ OwningPtr<Descriptor> RTNAME(Reshape)(const Descriptor &source,
return result;
}
extern "C" { // TODO - remove when Reshape is under extern "C"
// SPREAD
void RTNAME(Spread)(Descriptor &result, const Descriptor &source, int dim,

View File

@ -22,6 +22,13 @@
#include "memory.h"
namespace Fortran::runtime {
// TODO: redo API, put under extern "C"
OwningPtr<Descriptor> RTNAME(Reshape)(const Descriptor &source,
const Descriptor &shape, const Descriptor *pad = nullptr,
const Descriptor *order = nullptr, const char *sourceFile = nullptr,
int line = 0);
extern "C" {
void RTNAME(Cshift)(Descriptor &result, const Descriptor &source,
@ -41,12 +48,6 @@ void RTNAME(Pack)(Descriptor &result, const Descriptor &source,
const Descriptor &mask, const Descriptor *vector = nullptr,
const char *sourceFile = nullptr, int line = 0);
// TODO: redo API
OwningPtr<Descriptor> RTNAME(Reshape)(const Descriptor &source,
const Descriptor &shape, const Descriptor *pad = nullptr,
const Descriptor *order = nullptr, const char *sourceFile = nullptr,
int line = 0);
void RTNAME(Spread)(Descriptor &result, const Descriptor &source, int dim,
std::int64_t ncopies, const char *sourceFile = nullptr, int line = 0);