[flang-commits] [PATCH] D143818: [flang] Allow for user-defined intrinsic operators (regression)
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Mon Feb 13 09:24:35 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG176ee268f8df: [flang] Allow for user-defined intrinsic operators (regression) (authored by klausler).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143818/new/
https://reviews.llvm.org/D143818
Files:
flang/include/flang/Semantics/semantics.h
flang/lib/Semantics/expression.cpp
flang/lib/Semantics/resolve-names.cpp
Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -3176,6 +3176,11 @@
if (auto *symbol{FindInScope(GenericSpecInfo{x}.symbolName())}) {
SetGenericSymbol(*symbol);
}
+ if (const auto *opr{std::get_if<parser::DefinedOperator>(&x.u)}; opr &&
+ std::holds_alternative<parser::DefinedOperator::IntrinsicOperator>(
+ opr->u)) {
+ context().set_anyDefinedIntrinsicOperator(true);
+ }
return false;
}
Index: flang/lib/Semantics/expression.cpp
===================================================================
--- flang/lib/Semantics/expression.cpp
+++ flang/lib/Semantics/expression.cpp
@@ -3411,7 +3411,7 @@
if (expr.typedExpr) {
return expr.typedExpr->v;
}
- if (!wasIterativelyAnalyzing) {
+ if (!wasIterativelyAnalyzing && !context_.anyDefinedIntrinsicOperator()) {
iterativelyAnalyzingSubexpressions_ = true;
result = IterativelyAnalyzeSubexpressions(expr);
}
Index: flang/include/flang/Semantics/semantics.h
===================================================================
--- flang/include/flang/Semantics/semantics.h
+++ flang/include/flang/Semantics/semantics.h
@@ -145,6 +145,14 @@
return *this;
}
+ bool anyDefinedIntrinsicOperator() const {
+ return anyDefinedIntrinsicOperator_;
+ }
+ SemanticsContext &set_anyDefinedIntrinsicOperator(bool yes = true) {
+ anyDefinedIntrinsicOperator_ = yes;
+ return *this;
+ }
+
const DeclTypeSpec &MakeNumericType(TypeCategory, int kind = 0);
const DeclTypeSpec &MakeLogicalType(int kind = 0);
@@ -270,6 +278,7 @@
const Scope *builtinsScope_{nullptr}; // module __Fortran_builtins
std::list<parser::Program> modFileParseTrees_;
std::unique_ptr<CommonBlockMap> commonBlockMap_;
+ bool anyDefinedIntrinsicOperator_{false};
};
class Semantics {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143818.497021.patch
Type: text/x-patch
Size: 1961 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230213/2f82064f/attachment.bin>
More information about the flang-commits
mailing list