Skip to content

Commit

Permalink
[flang] Regularize TODO messages for coarray intrinsics (#70281)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
psteinfeld committed Oct 26, 2023
1 parent 2e85123 commit 38c9fab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flang/lib/Optimizer/Builder/IntrinsicCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,12 @@ static bool isIntrinsicModuleProcedure(llvm::StringRef name) {
name.startswith("ieee_") || name.startswith("__ppc_");
}

static bool isCoarrayIntrinsic(llvm::StringRef name) {
return name.startswith("atomic_") || name.startswith("co_") ||
name.contains("image") || name.endswith("cobound") ||
name.equals("team_number");
}

/// Return the generic name of an intrinsic module procedure specific name.
/// Remove any "__builtin_" prefix, and any specific suffix of the form
/// {_[ail]?[0-9]+}*, such as _1 or _a4.
Expand All @@ -1363,6 +1369,8 @@ llvm::StringRef genericName(llvm::StringRef specificName) {
void crashOnMissingIntrinsic(mlir::Location loc, llvm::StringRef name) {
if (isIntrinsicModuleProcedure(name))
TODO(loc, "intrinsic module procedure: " + llvm::Twine(name));
else if (isCoarrayIntrinsic(name))
TODO(loc, "coarray: intrinsic " + llvm::Twine(name));
else
TODO(loc, "intrinsic: " + llvm::Twine(name));
}
Expand Down

0 comments on commit 38c9fab

Please sign in to comment.