Skip to content

Commit 38c9fab

Browse files
authored
[flang] Regularize TODO messages for coarray intrinsics (#70281)
Apply a tag to coarray intrinsics to make them easier to recognize along with other coarray constructs. See pull request #69227 for a similar change.
1 parent 2e85123 commit 38c9fab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,12 @@ static bool isIntrinsicModuleProcedure(llvm::StringRef name) {
13431343
name.startswith("ieee_") || name.startswith("__ppc_");
13441344
}
13451345

1346+
static bool isCoarrayIntrinsic(llvm::StringRef name) {
1347+
return name.startswith("atomic_") || name.startswith("co_") ||
1348+
name.contains("image") || name.endswith("cobound") ||
1349+
name.equals("team_number");
1350+
}
1351+
13461352
/// Return the generic name of an intrinsic module procedure specific name.
13471353
/// Remove any "__builtin_" prefix, and any specific suffix of the form
13481354
/// {_[ail]?[0-9]+}*, such as _1 or _a4.
@@ -1363,6 +1369,8 @@ llvm::StringRef genericName(llvm::StringRef specificName) {
13631369
void crashOnMissingIntrinsic(mlir::Location loc, llvm::StringRef name) {
13641370
if (isIntrinsicModuleProcedure(name))
13651371
TODO(loc, "intrinsic module procedure: " + llvm::Twine(name));
1372+
else if (isCoarrayIntrinsic(name))
1373+
TODO(loc, "coarray: intrinsic " + llvm::Twine(name));
13661374
else
13671375
TODO(loc, "intrinsic: " + llvm::Twine(name));
13681376
}

0 commit comments

Comments
 (0)