diff --git a/compiler/pipes/inline-simple-functions.cpp b/compiler/pipes/inline-simple-functions.cpp index f6bbaefc8..45fa97ca9 100644 --- a/compiler/pipes/inline-simple-functions.cpp +++ b/compiler/pipes/inline-simple-functions.cpp @@ -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" @@ -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; diff --git a/compiler/pipes/inline-simple-functions.h b/compiler/pipes/inline-simple-functions.h index da5aedc44..c5f88a9f5 100644 --- a/compiler/pipes/inline-simple-functions.h +++ b/compiler/pipes/inline-simple-functions.h @@ -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; };