diff options
author | snermolaev <snermolaev@yandex-team.com> | 2023-11-09 09:29:52 +0300 |
---|---|---|
committer | snermolaev <snermolaev@yandex-team.com> | 2023-11-09 09:56:36 +0300 |
commit | bf4137f368480d63c49af7c60292d4862dad1d9a (patch) | |
tree | e0dab80b0b298367abcf4f44411b9b516c242d04 | |
parent | 49b036d38a50af696a69812c9ce5941a41054206 (diff) | |
download | ydb-bf4137f368480d63c49af7c60292d4862dad1d9a.tar.gz |
move CODEGEN related stuff to internal
-rw-r--r-- | build/plugins/split_codegen.py | 43 | ||||
-rw-r--r-- | build/ymake.core.conf | 39 |
2 files changed, 0 insertions, 82 deletions
diff --git a/build/plugins/split_codegen.py b/build/plugins/split_codegen.py deleted file mode 100644 index 4c3fe5cf2a..0000000000 --- a/build/plugins/split_codegen.py +++ /dev/null @@ -1,43 +0,0 @@ -from _common import sort_by_keywords - -# This hard-coded many times in CppParts in various codegens -_DEFAULT_CPP_PARTS = 20 -# See TCodegenParams::MethodStream usage in factor codegen -_ADDITIONAL_STREAM_COUNT = 5 - - -def onsplit_codegen(unit, *args): - ''' - @usage: SPLIT_CODEGEN(tool prefix opts... [OUT_NUM num] [OUTPUT_INCLUDES output_includes...]) - - Generator of a certain number of parts of the .cpp file + one header .h file from .in - - Supports keywords: - 1. OUT_NUM <the number of generated Prefix.N.cpp default 25 (N varies from 0 to 24)> - 2. OUTPUT_INCLUDES <path to files that will be included in generalnyj of macro files> - ''' - keywords = {"OUT_NUM": 1} - flat_args, spec_args = sort_by_keywords(keywords, args) - - num_outputs = _DEFAULT_CPP_PARTS + _ADDITIONAL_STREAM_COUNT - if "OUT_NUM" in spec_args: - num_outputs = int(spec_args["OUT_NUM"][0]) - - tool = flat_args[0] - prefix = flat_args[1] - - cmd = [tool, prefix, 'OUT'] - for num in range(num_outputs): - cmd.append('{}.{}.cpp'.format(prefix, num)) - - cpp_parts = int(num_outputs) - _ADDITIONAL_STREAM_COUNT - cpp_parts_args = ['--cpp-parts', str(cpp_parts)] - - if len(flat_args) > 2: - if flat_args[2] != 'OUTPUT_INCLUDES': - cmd.append('OPTS') - cmd += cpp_parts_args + flat_args[2:] - else: - cmd += ['OPTS'] + cpp_parts_args - - unit.on_split_codegen_base(cmd) diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 802a6e905d..6fa2cfc7b5 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -3834,43 +3834,6 @@ macro CONFIGURE_FILE(Src, Dst) { .SEM=set_vars ${CFG_VARS} && configure_file $S/${input;rootrel:Src} $B/${output;addincl;rootrel:Dst} } -### @usage: BASE_CODEGEN(tool_path prefix) -### -### Generator ${prefix}.cpp + ${prefix}.h files based on ${prefix}.in. -macro BASE_CODEGEN(Tool, Prefix, Opts...) { - .CMD=${tool:Tool} ${input:Prefix.in} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc yellow"} -} - -# tag:internal -### @usage: _SPLIT_CODEGEN_BASE(tool prefix OUTS[] OUTPUT_INCLUDES[]) # internal -### -### Generator of a certain number .the. cpp file + one header .h file from .in. -### This is the call of the generator. Python macro SPLIT_CODEGEN() is defined in order to properly fill command outputs from OUT_NUM argument. -macro _SPLIT_CODEGEN_BASE(Tool, Prefix, OUT[], OPTS[], OUTPUT_INCLUDES[]) { - .CMD=${tool:Tool} ${input:Prefix.in} ${output;hide:OUT} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $OPTS ${output_include;hide:OUTPUT_INCLUDES} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} -} - -STRUCT_CODEGEN_OUTPUT_INCLUDES=${output_include;hide:"util/generic/singleton.h"} \ -${output_include;hide:"util/generic/strbuf.h"} \ -${output_include;hide:"util/generic/vector.h"} \ -${output_include;hide:"util/generic/ptr.h"} \ -${output_include;hide:"util/generic/yexception.h"} \ -${output_include;hide:"kernel/struct_codegen/reflection/reflection.h"} \ -${output_include;hide:"kernel/struct_codegen/reflection/floats.h"} - -### @usage: STRUCT_CODEGEN(Prefix) -### A special case BASE_CODEGEN, in which the kernel/struct_codegen/codegen_tool tool is used. -macro STRUCT_CODEGEN(Prefix) { - .CMD=$BASE_CODEGEN(kernel/struct_codegen/codegen_tool, $Prefix, $STRUCT_CODEGEN_OUTPUT_INCLUDES) - .PEERDIR=kernel/struct_codegen/metadata kernel/struct_codegen/reflection -} - -### @usage: DUMPERF_CODEGEN(Prefix) -### A special case BASE_CODEGEN, in which the extsearch/images/robot/tools/dumperf/codegen tool is used -macro DUMPERF_CODEGEN(Prefix) { - .CMD=$BASE_CODEGEN(extsearch/images/robot/tools/dumperf/codegen, $Prefix, ${output_include;hide:"extsearch/images/kernel/erf/erf_format.h"}) -} - # tag:flags ### @usage: LDFLAGS(LinkerFlags...) ### @@ -4130,8 +4093,6 @@ macro _LUAJIT_OPENRESTY_OBJDUMP(Src, OUT="") { .CMD=${cwd:LUAJIT_OPENRESTY_PATH} ${tool:"contrib/libs/luajit_openresty/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} } -RELEV_FML_CODEGEN_INCLS=${output_include;hide:"kernel/relevfml/relev_fml.h"} ${output_include;hide:"library/cpp/sse/sse.h"} - ### @usage: GENERATE_ENUM_SERIALIZATION(File.h) ### ### Create serialization support for enumeration members defined in the header (String <-> Enum conversions) and compile it into the module. |