Skip to content

Commit

Permalink
internal interfaces methods are not inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
mkornaukhov03 committed Nov 1, 2024
1 parent 08a502a commit 8df4d7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions compiler/pipes/inline-simple-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "compiler/pipes/inline-simple-functions.h"

#include "compiler/data/class-data.h"
#include "compiler/data/src-file.h"
#include "compiler/data/var-data.h"
#include "compiler/inferring/public.h"
Expand Down Expand Up @@ -107,6 +108,17 @@ bool InlineSimpleFunctions::check_function(FunctionPtr function) const {
!function->kphp_lib_export;
}


void InlineSimpleFunctions::on_start() {
if (auto klass = current_function->class_id) {
if (klass->internal_interface) {
inline_is_possible_ = false;
}
}
return FunctionPassBase::on_start();
}


void InlineSimpleFunctions::on_finish() {
if (inline_is_possible_) {
current_function->is_inline = true;
Expand Down
1 change: 1 addition & 0 deletions compiler/pipes/inline-simple-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ class InlineSimpleFunctions final : public FunctionPassBase {
VertexPtr on_exit_vertex(VertexPtr root) final;
bool user_recursion(VertexPtr) final;
bool check_function(FunctionPtr function) const final;
void on_start() final;
void on_finish() final;
};

0 comments on commit 8df4d7e

Please sign in to comment.