Skip to content

Commit

Permalink
Add a comment explaining THUNK_BUILDER and THUNK_INVOKE
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
  • Loading branch information
DanilaFe committed Jul 3, 2024
1 parent 44306a1 commit 48022ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compiler/passes/checkResolved.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,13 @@ checkBadLocalReturn(FnSymbol* fn, Symbol* retVar) {
static void
checkReturnPaths(FnSymbol* fn) {
// Check to see if the function returns a value.
//
// FLAG_THUNK_BUILDER is analogous to isIterator (both produce a record
// that contains outer variables and other information), so they are
// next to each other in the if statement. Similarly, FLAG_THUNK_INVOKE
// is analogous to FLAG_AUTO_II (both mark compiler-generated methods
// on the thunk record / iterator record that are filled in late in
// compilation)
if (fn->isIterator() ||
fn->hasFlag(FLAG_THUNK_BUILDER) ||
!strcmp(fn->name, "=") || // TODO: Remove this to enforce new signature.
Expand Down

0 comments on commit 48022ea

Please sign in to comment.