Skip to content

Commit 5db4779

Browse files
authored
[flang] Regularize TODO messages for coarray related features (#69227)
I want to make "not yet implemented" messages for features related to coarrays easy to identify and make them easy for users to read.
1 parent f7a8a78 commit 5db4779

8 files changed

+30
-29
lines changed

flang/lib/Lower/Allocatable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ class AllocateStmtHelper {
462462
errorManager.genStatCheck(builder, loc);
463463
genAllocateObjectInit(box);
464464
if (alloc.hasCoarraySpec())
465-
TODO(loc, "coarray allocation");
465+
TODO(loc, "coarray: allocation of a coarray object");
466466
if (alloc.type.IsPolymorphic())
467467
genSetType(alloc, box, loc);
468468
genSetDeferredLengthParameters(alloc, box);
@@ -582,7 +582,7 @@ class AllocateStmtHelper {
582582
errorManager.genStatCheck(builder, loc);
583583
genAllocateObjectInit(box);
584584
if (alloc.hasCoarraySpec())
585-
TODO(loc, "coarray allocation");
585+
TODO(loc, "coarray: allocation of a coarray object");
586586
// Set length of the allocate object if it has. Otherwise, get the length
587587
// from source for the deferred length parameter.
588588
if (lenParams.empty() && box.isCharacter() &&

flang/lib/Lower/Bridge.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,35 +2625,35 @@ class FirConverter : public Fortran::lower::AbstractConverter {
26252625
}
26262626

26272627
void genFIR(const Fortran::parser::ChangeTeamConstruct &construct) {
2628-
TODO(toLocation(), "ChangeTeamConstruct implementation");
2628+
TODO(toLocation(), "coarray: ChangeTeamConstruct");
26292629
}
26302630
void genFIR(const Fortran::parser::ChangeTeamStmt &stmt) {
2631-
TODO(toLocation(), "ChangeTeamStmt implementation");
2631+
TODO(toLocation(), "coarray: ChangeTeamStmt");
26322632
}
26332633
void genFIR(const Fortran::parser::EndChangeTeamStmt &stmt) {
2634-
TODO(toLocation(), "EndChangeTeamStmt implementation");
2634+
TODO(toLocation(), "coarray: EndChangeTeamStmt");
26352635
}
26362636

26372637
void genFIR(const Fortran::parser::CriticalConstruct &criticalConstruct) {
26382638
setCurrentPositionAt(criticalConstruct);
2639-
TODO(toLocation(), "CriticalConstruct implementation");
2639+
TODO(toLocation(), "coarray: CriticalConstruct");
26402640
}
26412641
void genFIR(const Fortran::parser::CriticalStmt &) {
2642-
TODO(toLocation(), "CriticalStmt implementation");
2642+
TODO(toLocation(), "coarray: CriticalStmt");
26432643
}
26442644
void genFIR(const Fortran::parser::EndCriticalStmt &) {
2645-
TODO(toLocation(), "EndCriticalStmt implementation");
2645+
TODO(toLocation(), "coarray: EndCriticalStmt");
26462646
}
26472647

26482648
void genFIR(const Fortran::parser::SelectRankConstruct &selectRankConstruct) {
26492649
setCurrentPositionAt(selectRankConstruct);
2650-
TODO(toLocation(), "SelectRankConstruct implementation");
2650+
TODO(toLocation(), "coarray: SelectRankConstruct");
26512651
}
26522652
void genFIR(const Fortran::parser::SelectRankStmt &) {
2653-
TODO(toLocation(), "SelectRankStmt implementation");
2653+
TODO(toLocation(), "coarray: SelectRankStmt");
26542654
}
26552655
void genFIR(const Fortran::parser::SelectRankCaseStmt &) {
2656-
TODO(toLocation(), "SelectRankCaseStmt implementation");
2656+
TODO(toLocation(), "coarray: SelectRankCaseStmt");
26572657
}
26582658

26592659
void genFIR(const Fortran::parser::SelectTypeConstruct &selectTypeConstruct) {

flang/lib/Lower/CallInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ class Fortran::lower::CallInterfaceImpl {
952952
if (shapeAttrs.test(ShapeAttr::AssumedRank))
953953
TODO(loc, "assumed rank in procedure interface");
954954
if (shapeAttrs.test(ShapeAttr::Coarray))
955-
TODO(loc, "coarray in procedure interface");
955+
TODO(loc, "coarray: dummy argument coarray in procedure interface");
956956

957957
// So far assume that if the argument cannot be passed by implicit interface
958958
// it must be by box. That may no be always true (e.g for simple optionals)

flang/lib/Lower/Coarray.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ void Fortran::lower::genChangeTeamConstruct(
2727
Fortran::lower::AbstractConverter &converter,
2828
Fortran::lower::pft::Evaluation &,
2929
const Fortran::parser::ChangeTeamConstruct &) {
30-
TODO(converter.getCurrentLocation(), "CHANGE TEAM construct");
30+
TODO(converter.getCurrentLocation(), "coarray: CHANGE TEAM construct");
3131
}
3232

3333
void Fortran::lower::genChangeTeamStmt(
3434
Fortran::lower::AbstractConverter &converter,
3535
Fortran::lower::pft::Evaluation &,
3636
const Fortran::parser::ChangeTeamStmt &) {
37-
TODO(converter.getCurrentLocation(), "CHANGE TEAM stmt");
37+
TODO(converter.getCurrentLocation(), "coarray: CHANGE TEAM statement");
3838
}
3939

4040
void Fortran::lower::genEndChangeTeamStmt(
4141
Fortran::lower::AbstractConverter &converter,
4242
Fortran::lower::pft::Evaluation &,
4343
const Fortran::parser::EndChangeTeamStmt &) {
44-
TODO(converter.getCurrentLocation(), "END CHANGE TEAM");
44+
TODO(converter.getCurrentLocation(), "coarray: END CHANGE TEAM statement");
4545
}
4646

4747
void Fortran::lower::genFormTeamStatement(
4848
Fortran::lower::AbstractConverter &converter,
4949
Fortran::lower::pft::Evaluation &, const Fortran::parser::FormTeamStmt &) {
50-
TODO(converter.getCurrentLocation(), "FORM TEAM");
50+
TODO(converter.getCurrentLocation(), "coarray: FORM TEAM statement");
5151
}
5252

5353
//===----------------------------------------------------------------------===//

flang/lib/Lower/ConvertExpr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3814,7 +3814,7 @@ class ArrayExprLowering {
38143814
return false;
38153815
}
38163816
bool genShapeFromDataRef(const Fortran::evaluate::CoarrayRef &) {
3817-
TODO(getLoc(), "coarray ref");
3817+
TODO(getLoc(), "coarray: reference to a coarray in an expression");
38183818
return false;
38193819
}
38203820
bool genShapeFromDataRef(const Fortran::evaluate::Component &x) {
@@ -7091,7 +7091,7 @@ class ArrayExprLowering {
70917091
}
70927092

70937093
CC genarr(const Fortran::evaluate::CoarrayRef &x, ComponentPath &components) {
7094-
TODO(getLoc(), "coarray reference");
7094+
TODO(getLoc(), "coarray: reference to a coarray in an expression");
70957095
}
70967096

70977097
CC genarr(const Fortran::evaluate::NamedEntity &x,

flang/lib/Lower/ConvertExprToHLFIR.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ class HlfirDesignatorBuilder {
371371

372372
fir::FortranVariableOpInterface
373373
gen(const Fortran::evaluate::CoarrayRef &coarrayRef) {
374-
TODO(getLoc(), "lowering CoarrayRef to HLFIR");
374+
TODO(getLoc(), "coarray: lowering a reference to a coarray object");
375375
}
376376

377377
mlir::Type visit(const Fortran::evaluate::CoarrayRef &, PartInfo &) {
378-
TODO(getLoc(), "lowering CoarrayRef to HLFIR");
378+
TODO(getLoc(), "coarray: lowering a reference to a coarray object");
379379
}
380380

381381
fir::FortranVariableOpInterface

flang/lib/Lower/Runtime.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,49 +140,49 @@ void Fortran::lower::genFailImageStatement(
140140
void Fortran::lower::genEventPostStatement(
141141
Fortran::lower::AbstractConverter &converter,
142142
const Fortran::parser::EventPostStmt &) {
143-
TODO(converter.getCurrentLocation(), "EVENT POST runtime");
143+
TODO(converter.getCurrentLocation(), "coarray: EVENT POST runtime");
144144
}
145145

146146
void Fortran::lower::genEventWaitStatement(
147147
Fortran::lower::AbstractConverter &converter,
148148
const Fortran::parser::EventWaitStmt &) {
149-
TODO(converter.getCurrentLocation(), "EVENT WAIT runtime");
149+
TODO(converter.getCurrentLocation(), "coarray: EVENT WAIT runtime");
150150
}
151151

152152
void Fortran::lower::genLockStatement(
153153
Fortran::lower::AbstractConverter &converter,
154154
const Fortran::parser::LockStmt &) {
155-
TODO(converter.getCurrentLocation(), "LOCK runtime");
155+
TODO(converter.getCurrentLocation(), "coarray: LOCK runtime");
156156
}
157157

158158
void Fortran::lower::genUnlockStatement(
159159
Fortran::lower::AbstractConverter &converter,
160160
const Fortran::parser::UnlockStmt &) {
161-
TODO(converter.getCurrentLocation(), "UNLOCK runtime");
161+
TODO(converter.getCurrentLocation(), "coarray: UNLOCK runtime");
162162
}
163163

164164
void Fortran::lower::genSyncAllStatement(
165165
Fortran::lower::AbstractConverter &converter,
166166
const Fortran::parser::SyncAllStmt &) {
167-
TODO(converter.getCurrentLocation(), "SYNC ALL runtime");
167+
TODO(converter.getCurrentLocation(), "coarray: SYNC ALL runtime");
168168
}
169169

170170
void Fortran::lower::genSyncImagesStatement(
171171
Fortran::lower::AbstractConverter &converter,
172172
const Fortran::parser::SyncImagesStmt &) {
173-
TODO(converter.getCurrentLocation(), "SYNC IMAGES runtime");
173+
TODO(converter.getCurrentLocation(), "coarray: SYNC IMAGES runtime");
174174
}
175175

176176
void Fortran::lower::genSyncMemoryStatement(
177177
Fortran::lower::AbstractConverter &converter,
178178
const Fortran::parser::SyncMemoryStmt &) {
179-
TODO(converter.getCurrentLocation(), "SYNC MEMORY runtime");
179+
TODO(converter.getCurrentLocation(), "coarray: SYNC MEMORY runtime");
180180
}
181181

182182
void Fortran::lower::genSyncTeamStatement(
183183
Fortran::lower::AbstractConverter &converter,
184184
const Fortran::parser::SyncTeamStmt &) {
185-
TODO(converter.getCurrentLocation(), "SYNC TEAM runtime");
185+
TODO(converter.getCurrentLocation(), "coarray: SYNC TEAM runtime");
186186
}
187187

188188
void Fortran::lower::genPauseStatement(

flang/lib/Lower/VectorSubscripts.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ class VectorSubscriptBoxBuilder {
212212

213213
mlir::Type gen(const Fortran::evaluate::CoarrayRef &) {
214214
// Is this possible/legal ?
215-
TODO(loc, "coarray ref with vector subscript in IO input");
215+
TODO(loc, "coarray: reference to coarray object with vector subscript in "
216+
"IO input");
216217
}
217218

218219
template <typename A>

0 commit comments

Comments
 (0)