Skip to content

Commit

Permalink
Wire up new helpers in 'builderResultForDefaultFunction'
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Harshbarger <[email protected]>
  • Loading branch information
benharsh committed Dec 10, 2024
1 parent 07585d5 commit f825dd9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/lib/resolution/default-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,14 @@ builderResultForDefaultFunction(Context* context,

if (name == USTR("init")) {
return &buildInitializer(context, typeID);
} else if (name == USTR("init=")) {
return &buildInitEquals(context, typeID);
} else if (name == USTR("deinit")) {
return &buildDeinit(context, typeID);
} else if (name == USTR("serialize")) {
return &buildDeSerialize(context, typeID, true);
} else if (name == USTR("deserialize")) {
return &buildDeSerialize(context, typeID, false);
} else if (typeID.symbolName(context) == name) {
return &buildTypeConstructor(context, typeID);
}
Expand Down
3 changes: 3 additions & 0 deletions frontend/lib/resolution/default-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ getCompilerGeneratedBinaryOp(Context* context,
UniqueString name);

const uast::BuilderResult& buildInitializer(Context* context, ID typeID);
const uast::BuilderResult& buildInitEquals(Context* context, ID typeID);
const uast::BuilderResult& buildTypeConstructor(Context* context, ID typeID);
const uast::BuilderResult& buildDeinit(Context* context, ID typeID);
const uast::BuilderResult& buildDeSerialize(Context* context, ID typeID, bool isSerializer);

} // end namespace resolution
} // end namespace chpl
Expand Down

0 comments on commit f825dd9

Please sign in to comment.