Skip to content

Commit d4609ae

Browse files
committed
[flang] Change "bad kind" messages in the runtime to "not yet implemented"
Similar to change D125046. If a programmer is able to compile and link a program that contains types that are not yet supported by the runtime, it must be because they're not yet implemented. This change will make it easier to find unimplemented code in tests. Differential Revision: https://reviews.llvm.org/D125267
1 parent cb22cb2 commit d4609ae

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

flang/runtime/character.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static void LenTrimKind(Descriptor &result, const Descriptor &string, int kind,
253253
result, string, terminator);
254254
break;
255255
default:
256-
terminator.Crash("LEN_TRIM: bad KIND=%d", kind);
256+
terminator.Crash("not yet implemented: LEN_TRIM: KIND=%d", kind);
257257
}
258258
}
259259

@@ -454,7 +454,7 @@ static void GeneralCharFuncKind(Descriptor &result, const Descriptor &string,
454454
result, string, arg, back, terminator);
455455
break;
456456
default:
457-
terminator.Crash("INDEX/SCAN/VERIFY: bad KIND=%d", kind);
457+
terminator.Crash("not yet implemented: INDEX/SCAN/VERIFY: KIND=%d", kind);
458458
}
459459
}
460460

flang/runtime/random.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ void RTNAME(RandomNumber)(
108108
break;
109109
#endif
110110
default:
111-
terminator.Crash("RANDOM_NUMBER(): bad REAL kind %d", kind);
111+
terminator.Crash(
112+
"not yet implemented: RANDOM_NUMBER(): REAL kind %d", kind);
112113
}
113114
}
114115

@@ -127,7 +128,8 @@ void RTNAME(RandomSeedSize)(
127128
*size.OffsetElement<CppTypeFor<TypeCategory::Integer, 8>>() = 1;
128129
break;
129130
default:
130-
terminator.Crash("RANDOM_SEED(SIZE=): bad kind %d\n", kind);
131+
terminator.Crash(
132+
"not yet implemented: RANDOM_SEED(SIZE=): kind %d\n", kind);
131133
}
132134
}
133135

@@ -148,7 +150,7 @@ void RTNAME(RandomSeedPut)(
148150
seed = *put.OffsetElement<CppTypeFor<TypeCategory::Integer, 8>>();
149151
break;
150152
default:
151-
terminator.Crash("RANDOM_SEED(PUT=): bad kind %d\n", kind);
153+
terminator.Crash("not yet implemented: RANDOM_SEED(PUT=): kind %d\n", kind);
152154
}
153155
{
154156
CriticalSection critical{lock};
@@ -186,7 +188,7 @@ void RTNAME(RandomSeedGet)(
186188
*got.OffsetElement<CppTypeFor<TypeCategory::Integer, 8>>() = seed;
187189
break;
188190
default:
189-
terminator.Crash("RANDOM_SEED(GET=): bad kind %d\n", kind);
191+
terminator.Crash("not yet implemented: RANDOM_SEED(GET=): kind %d\n", kind);
190192
}
191193
}
192194
} // extern "C"

flang/runtime/tools.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ void CheckConformability(const Descriptor &to, const Descriptor &x,
106106

107107
void CheckIntegerKind(Terminator &terminator, int kind, const char *intrinsic) {
108108
if (kind < 1 || kind > 16 || (kind & (kind - 1)) != 0) {
109-
terminator.Crash("%s: bad KIND=%d argument", intrinsic, kind);
109+
terminator.Crash(
110+
"not yet implemented: %s: KIND=%d argument", intrinsic, kind);
110111
}
111112
}
112113
} // namespace Fortran::runtime

flang/runtime/transformational.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void DefaultInitialize(
106106
static_cast<char32_t>(' '));
107107
break;
108108
default:
109-
terminator.Crash("EOSHIFT: bad CHARACTER kind %d", kind);
109+
terminator.Crash("not yet implemented: EOSHIFT: CHARACTER kind %d", kind);
110110
}
111111
} else {
112112
std::memset(result.raw().base_addr, 0, bytes);

0 commit comments

Comments
 (0)