Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stubs for internal classes #1093

Merged
merged 28 commits into from
Sep 6, 2024

Conversation

astrophysik
Copy link
Contributor

@astrophysik astrophysik commented Sep 3, 2024

next part of #1078

General

Add notation /** @kphp-generate-stub-class */ for generating internal class stub. Also prohibit visitors for runtime light
Main changes in /compiler, /runtime-core

@astrophysik astrophysik marked this pull request as ready for review September 3, 2024 14:45
@astrophysik astrophysik self-assigned this Sep 3, 2024
@astrophysik astrophysik added the k2 k2 related label Sep 3, 2024
compiler/code-gen/declarations.cpp Outdated Show resolved Hide resolved
compiler/code-gen/declarations.cpp Outdated Show resolved Hide resolved
compiler/pipes/collect-required-and-classes.cpp Outdated Show resolved Hide resolved
compiler/pipes/sort-and-inherit-classes.cpp Show resolved Hide resolved
runtime-light/stdlib/exception/exception.h Outdated Show resolved Hide resolved
runtime-light/stdlib/function-handling/function-handling.h Outdated Show resolved Hide resolved
runtime-light/stdlib/function-handling/function-handling.h Outdated Show resolved Hide resolved
runtime-light/stdlib/regex/regex-functions.h Outdated Show resolved Hide resolved
runtime-light/stdlib/system/system.h Outdated Show resolved Hide resolved
compiler/data/class-data.cpp Outdated Show resolved Hide resolved
runtime-core/runtime-core.h Outdated Show resolved Hide resolved
@astrophysik astrophysik force-pushed the vsadokhov/compile-unsupported-classes branch from 7262b87 to cbbea14 Compare September 6, 2024 08:29
@@ -65,7 +65,8 @@ function in_array ($value ::: any, $a ::: array, $strict ::: bool = false) ::: b
function array_fill ($start_index ::: int, $num ::: int, $value ::: any) ::: ^3[];
function array_fill_keys ($a ::: array, $value ::: any) ::: ^2[];
function array_combine ($keys ::: array, $values ::: array) ::: ^2;
function range ($from, $to, $step ::: int = 1) ::: mixed[];//TODO
/** @kphp-extern-func-info generate-stub */
function range ($from ::: mixed, $to ::: mixed, $step ::: int = 1) ::: mixed[];//TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does TODO comment mean here?
Please remove or provide better description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. It came from _functions.txt. Remove it

@@ -354,8 +354,7 @@ bool ClassData::has_polymorphic_member_dfs(std::unordered_set<ClassPtr> &checked
}

bool ClassData::does_need_codegen() const {
return !is_builtin() && !is_trait() &&
(really_used || is_tl_class);
return (is_builtin() && need_generated_stub) || (!is_builtin() && !is_trait() && (really_used || is_tl_class));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(is_builtin() && need_generated_stub) <=> need_generated_stub, but up to you

mkornaukhov03
mkornaukhov03 previously approved these changes Sep 6, 2024
Copy link
Contributor

@mkornaukhov03 mkornaukhov03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@astrophysik astrophysik merged commit b30b495 into master Sep 6, 2024
5 checks passed
@astrophysik astrophysik deleted the vsadokhov/compile-unsupported-classes branch September 6, 2024 11:57
@astrophysik astrophysik added this to the next milestone Sep 6, 2024
astrophysik added a commit that referenced this pull request Sep 17, 2024
Compile unsupported phpt test in k2 mode. Continuation of #1093
@astrophysik astrophysik added the compiler Feature related to compiler label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Feature related to compiler k2 k2 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants