aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Evaluate/characteristics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Evaluate/characteristics.cpp')
-rw-r--r--flang/lib/Evaluate/characteristics.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/flang/lib/Evaluate/characteristics.cpp b/flang/lib/Evaluate/characteristics.cpp
index 37c62c9..542f122 100644
--- a/flang/lib/Evaluate/characteristics.cpp
+++ b/flang/lib/Evaluate/characteristics.cpp
@@ -458,7 +458,7 @@ std::optional<DummyDataObject> DummyDataObject::Characterize(
}
bool DummyDataObject::CanBePassedViaImplicitInterface(
- std::string *whyNot) const {
+ std::string *whyNot, bool checkCUDA) const {
if ((attrs &
Attrs{Attr::Allocatable, Attr::Asynchronous, Attr::Optional,
Attr::Pointer, Attr::Target, Attr::Value, Attr::Volatile})
@@ -482,7 +482,7 @@ bool DummyDataObject::CanBePassedViaImplicitInterface(
*whyNot = "a dummy argument is polymorphic";
}
return false; // 15.4.2.2(3)(f)
- } else if (cudaDataAttr) {
+ } else if (checkCUDA && cudaDataAttr) {
if (whyNot) {
*whyNot = "a dummy argument has a CUDA data attribute";
}
@@ -1012,9 +1012,10 @@ common::Intent DummyArgument::GetIntent() const {
u);
}
-bool DummyArgument::CanBePassedViaImplicitInterface(std::string *whyNot) const {
+bool DummyArgument::CanBePassedViaImplicitInterface(
+ std::string *whyNot, bool checkCUDA) const {
if (const auto *object{std::get_if<DummyDataObject>(&u)}) {
- return object->CanBePassedViaImplicitInterface(whyNot);
+ return object->CanBePassedViaImplicitInterface(whyNot, checkCUDA);
} else if (const auto *proc{std::get_if<DummyProcedure>(&u)}) {
return proc->CanBePassedViaImplicitInterface(whyNot);
} else {
@@ -1501,7 +1502,8 @@ std::optional<Procedure> Procedure::FromActuals(const ProcedureDesignator &proc,
return callee;
}
-bool Procedure::CanBeCalledViaImplicitInterface(std::string *whyNot) const {
+bool Procedure::CanBeCalledViaImplicitInterface(
+ std::string *whyNot, bool checkCUDA) const {
if (attrs.test(Attr::Elemental)) {
if (whyNot) {
*whyNot = "the procedure is elemental";
@@ -1524,7 +1526,7 @@ bool Procedure::CanBeCalledViaImplicitInterface(std::string *whyNot) const {
return false;
} else {
for (const DummyArgument &arg : dummyArguments) {
- if (!arg.CanBePassedViaImplicitInterface(whyNot)) {
+ if (!arg.CanBePassedViaImplicitInterface(whyNot, checkCUDA)) {
return false;
}
}