Skip to content

[flang][NFC] Restore I/O runtime API header name #132423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions flang-rt/lib/runtime/io-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@
namespace Fortran::runtime::io {
RT_EXT_API_GROUP_BEGIN

RT_API_ATTRS const char *InquiryKeywordHashDecode(
char *buffer, std::size_t n, InquiryKeywordHash hash) {
if (n < 1) {
return nullptr;
}
char *p{buffer + n};
*--p = '\0';
while (hash > 1) {
if (p < buffer) {
return nullptr;
}
*--p = 'A' + (hash % 26);
hash /= 26;
}
return hash == 1 ? p : nullptr;
}

template <Direction DIR>
RT_API_ATTRS Cookie BeginInternalArrayListIO(const Descriptor &descriptor,
void ** /*scratchArea*/, std::size_t /*scratchBytes*/,
Expand Down
17 changes: 17 additions & 0 deletions flang-rt/lib/runtime/io-stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ bool IoStatementBase::Inquire(InquiryKeywordHash, std::int64_t &) {
return false;
}

RT_API_ATTRS static const char *InquiryKeywordHashDecode(
char *buffer, std::size_t n, InquiryKeywordHash hash) {
if (n < 1) {
return nullptr;
}
char *p{buffer + n};
*--p = '\0';
while (hash > 1) {
if (p < buffer) {
return nullptr;
}
*--p = 'A' + (hash % 26);
hash /= 26;
}
return hash == 1 ? p : nullptr;
}

void IoStatementBase::BadInquiryKeywordHashCrash(InquiryKeywordHash inquiry) {
char buffer[16];
const char *decode{InquiryKeywordHashDecode(buffer, sizeof buffer, inquiry)};
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/ExternalIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "CrashHandlerFixture.h"
#include "gtest/gtest.h"
#include "flang-rt/runtime/descriptor.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"
#include "flang/Runtime/main.h"
#include "flang/Runtime/stop.h"
#include "llvm/Support/raw_ostream.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/ListInputTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "CrashHandlerFixture.h"
#include "flang-rt/runtime/descriptor.h"
#include "flang-rt/runtime/io-error.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"

using namespace Fortran::runtime;
using namespace Fortran::runtime::io;
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/LogicalFormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "CrashHandlerFixture.h"
#include "flang-rt/runtime/descriptor.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"
#include <algorithm>
#include <array>
#include <cstring>
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/Namelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "CrashHandlerFixture.h"
#include "tools.h"
#include "flang-rt/runtime/descriptor.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"
#include <algorithm>
#include <cinttypes>
#include <complex>
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/NumericalFormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "CrashHandlerFixture.h"
#include "flang-rt/runtime/descriptor.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"
#include <algorithm>
#include <array>
#include <cstring>
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/RuntimeCrashTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "CrashHandlerFixture.h"
#include "tools.h"
#include "flang-rt/runtime/terminator.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"
#include "flang/Runtime/transformational.h"
#include <gtest/gtest.h>

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "flang/Optimizer/Builder/FIRBuilder.h"
#include "flang/Optimizer/Dialect/FIRDialect.h"
#include "flang/Optimizer/Dialect/FIRType.h"
#include "flang/Runtime/io-api-consts.h"
#include "flang/Runtime/io-api.h"
#include "flang/Runtime/reduce.h"
#include "flang/Support/Fortran.h"
#include "mlir/IR/BuiltinTypes.h"
Expand Down
Loading
Loading