Skip to content

Commit 650367c

Browse files
committed
cleanup
1 parent 725f1a0 commit 650367c

15 files changed

+18
-29
lines changed

compiler/compiler.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,6 @@ target_link_libraries(kphp2cpp PRIVATE ${COMPILER_LIBS})
285285
target_link_options(kphp2cpp PRIVATE ${NO_PIE})
286286
set_target_properties(kphp2cpp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR})
287287

288-
# todo make as option, like asan
289-
# target_compile_options(kphp2cpp PUBLIC "-fsanitize=thread" "-fPIC")
290-
# target_compile_options(kphp2cpp_src PUBLIC "-fsanitize=thread" "-fPIC")
291-
# target_link_options(kphp2cpp PUBLIC "-fsanitize=thread" "-fPIC")
292-
# target_link_options(kphp2cpp_src PUBLIC "-fsanitize=thread" "-fPIC")
293-
294288
add_dependencies(kphp2cpp_src auto_vertices_generation_target)
295289
if(COMPILE_RUNTIME_LIGHT)
296290
add_compile_definitions(RUNTIME_LIGHT)

compiler/data/function-data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class FunctionData {
5656
std::vector<VarPtr> local_var_ids, global_var_ids, static_var_ids, param_ids;
5757
std::unordered_set<VarPtr> *bad_vars = nullptr; // for check ub and safe operations wrapper, see comments in check-ub.cpp
5858
std::set<VarPtr> implicit_const_var_ids, explicit_const_var_ids, explicit_header_const_var_ids;
59-
std::vector<FunctionPtr> dep; // should wait on them in some passes; may be deadlock?
59+
std::vector<FunctionPtr> dep;
6060
std::set<ClassPtr> class_dep;
6161
std::set<ClassPtr> exceptions_thrown; // exceptions that can be thrown by this function
6262
bool tl_common_h_dep = false;

compiler/data/var-data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
#pragma once
66

7-
#include "common/wrappers/copyable-atomic.h"
87
#include <cstdint>
98
#include <string>
109

10+
#include "common/wrappers/copyable-atomic.h"
1111
#include "compiler/data/class-members.h"
1212
#include "compiler/debug.h"
1313
#include "compiler/inferring/var-node.h"

compiler/gentree.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,6 @@ VertexAdaptor<op_function> GenTree::get_function(bool is_lambda, const PhpDocCom
16071607
cur_function->root->cmd_ref() = VertexAdaptor<op_seq>::create();
16081608
}
16091609

1610-
// think about this place later
16111610
auto resp = cur_function->root;
16121611

16131612
// the function is ready, register it;
@@ -1619,8 +1618,7 @@ VertexAdaptor<op_function> GenTree::get_function(bool is_lambda, const PhpDocCom
16191618
|| cur_function->modifiers.is_instance()
16201619
|| cur_function->is_lambda()
16211620
|| kphp_required_flag;
1622-
G->register_and_require_function(cur_function, parsed_os, auto_require); // here we pass function further
1623-
// Next passes with cur function may ends before this line
1621+
G->register_and_require_function(cur_function, parsed_os, auto_require); // pass function further
16241622
}
16251623

16261624
return resp;

compiler/inferring/node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
#pragma once
66

7-
#include "common/wrappers/copyable-atomic.h"
87
#include <atomic>
98
#include <string>
109
#include <forward_list>
1110

11+
#include "common/wrappers/copyable-atomic.h"
1212
#include "compiler/debug.h"
13-
#include "compiler/location.h"
1413
#include "compiler/inferring/type-data.h"
14+
#include "compiler/location.h"
1515
#include "compiler/threading/locks.h"
1616

1717
namespace tinf {

compiler/inferring/type-node.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Compiler for PHP (aka KPHP)
2-
// Copyright (c) 2020 LLC «V Kontakte»
2+
// Copyright (c) 2024 LLC «V Kontakte»
33
// Distributed under the GPL v3 License, see LICENSE.notice.txt
44

5-
#include "compiler/inferring/type-node.h"
5+
#include <atomic>
66

77
#include "compiler/inferring/type-data.h"
8+
#include "compiler/inferring/type-node.h"
89
#include "compiler/stage.h"
9-
#include <atomic>
1010

1111
std::string tinf::TypeNode::get_description() {
1212
return "TypeNode at " + location_.as_human_readable() + " : " + type_.load(std::memory_order_relaxed)->as_human_readable();

compiler/pipes/check-func-calls-and-vararg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ VertexPtr CheckFuncCallsAndVarargPass::on_func_call(VertexAdaptor<op_func_call>
250250
fmt_format("Can not call an abstract method {}()", f->as_human_readable()));
251251
}
252252

253-
VertexRange func_params = f->get_params(); // read here, f is concurrently processed in this pass
253+
VertexRange func_params = f->get_params();
254254
VertexRange call_params = call->args();
255255

256256
if (call_params.size() < func_params.size()) {

compiler/pipes/collect-const-vars.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
#include "compiler/pipes/collect-const-vars.h"
66

7+
#include <atomic>
8+
79
#include "compiler/data/src-file.h"
810
#include "compiler/vertex-util.h"
911
#include "compiler/data/var-data.h"
1012
#include "compiler/const-manipulations.h"
1113
#include "compiler/compiler-core.h"
1214
#include "compiler/name-gen.h"
13-
#include <atomic>
1415

1516
namespace {
1617

compiler/pipes/deduce-implicit-types-and-casts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ void DeduceImplicitTypesAndCastsPass::on_func_call(VertexAdaptor<op_func_call> c
605605

606606
FunctionPtr f_called = call->func_id;
607607
auto call_args = call->args();
608-
auto f_called_params = f_called->get_params(); // f_called is concurrently processed in TransformToSmartInstanceofPass
608+
auto f_called_params = f_called->get_params();
609609

610610
// if we are calling `f<T>`, then `f` has not been instantiated yet at this point, so we have a generic func call
611611
// at first, we need to know all generic types (call->reifiedTs)

compiler/pipes/sort-and-inherit-classes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void SortAndInheritClassesF::execute(ClassPtr klass, MultipleDataStreams<Functio
367367
}
368368

369369
node->data.waiting.clear();
370-
node->data.done = true; // write
370+
node->data.done = true;
371371
}
372372

373373
void SortAndInheritClassesF::check_on_finish(DataStream<FunctionPtr> &os) {

0 commit comments

Comments
 (0)