Skip to content

Commit

Permalink
[flang] Support for type-bound operators and assignment
Browse files Browse the repository at this point in the history
Add `ArgumentAnalyzer::FindBoundOp` to look for an operator or
assignment definition in the type of each operand. Then `TryBoundOp`
checks if it is actually applicable.

Change ResolveGeneric to handle type-bound operators: the `adjustActuals`
function passed in handles the difference between these and normal
type-bound procedures. For operators, either operand may be the passed-
object argument. For procedures we know which one it is.

Extract `GetDerivedTypeSpec`, `GetBindingResolution`, and
`OkLogicalIntegerAssignment` into separate functions to simplify the
logic of the calling functions.

Original-commit: flang-compiler/f18@1f7ff22
Reviewed-on: flang-compiler/f18#872
Tree-same-pre-rewrite: false
  • Loading branch information
tskeith committed Dec 16, 2019
1 parent 968eabb commit e567bf9
Show file tree
Hide file tree
Showing 6 changed files with 386 additions and 109 deletions.
4 changes: 4 additions & 0 deletions flang/lib/parser/message.h
Expand Up @@ -298,6 +298,10 @@ class ContextualMessages {
common::Restorer<Messages *> SetMessages(Messages &buffer) {
return common::ScopedSet(messages_, &buffer);
}
// Discard messages; destination restored when the returned value is deleted.
common::Restorer<Messages *> DiscardMessages() {
return common::ScopedSet(messages_, nullptr);
}

template<typename... A> Message *Say(CharBlock at, A &&... args) {
if (messages_ != nullptr) {
Expand Down

0 comments on commit e567bf9

Please sign in to comment.