Added SELECT RANK implementation.
Previous review- https://github.com/flang-compiler/f18/pull/895
Details
Diff Detail
Event Timeline
LGTM but I'm not an expert on this code so wait for approval from someone else
flang/lib/Semantics/resolve-names.cpp | ||
---|---|---|
5111 | Why does this need de-referencing and then referencing again? |
flang/include/flang/Semantics/symbol.h | ||
---|---|---|
149 | I think rank and rank_ are better names than associationRank and associationRank_. | |
flang/lib/Evaluate/shape.cpp | ||
461 | Can you extract all of the copies of this code into a single function? | |
flang/lib/Semantics/check-select-rank.cpp | ||
70 | You could show where the previous DEFAULT is. | |
79 | Same here. | |
116 | I think GetExpr is a better name for this function. Nothing is being resolved. | |
124 | You should be able to write this as: Or maybe change GetExpr to operate on any union class as it does on wrapper classes. | |
flang/lib/Semantics/resolve-names.cpp | ||
5147 | Why do you need this Walk? Didn't it just get visited? | |
flang/lib/Semantics/symbol.cpp | ||
290 | I don't think this belongs in Symbol. It is only called in one place and it's not consistent with GetRank. You can get the rank of all kinds of symbols but you can set it on only one particular kind. | |
292 | Details should be details. | |
flang/test/Semantics/select-rank.f90 | ||
76 | "default" -> "DEFAULT" | |
93 | This message could say what the bad value is. If it's an expression it may not be obvious. |
@peterklauslar @timkeith is there still anything which needs to be addressed to merge this PR?
flang/lib/Semantics/check-select-rank.cpp | ||
---|---|---|
114 | Updated revision using *val. | |
116 | Two same names were causing confusion, hence added a different name GetExprFromSelector. |
flang/lib/Semantics/resolve-names.cpp | ||
---|---|---|
5111 | Because it's not a pointer. |
flang/lib/Semantics/resolve-names.cpp | ||
---|---|---|
5111 | No.. and neither is the thing it is being assigned to? I don't understand how it not being a pointer is relevant. |
flang/lib/Semantics/resolve-names.cpp | ||
---|---|---|
5111 | name is a reference to a std::optional<parser::Name>. *name is a reference to a parser::Name. &*name is an rvalue pointer to a parser::Name. association.name is an lvalue whose type is pointer to a const parser::Name. association.name = &*name; assigns a pointer rvalue to a pointer lvalue. |
How about CreateShape?