Skip to content

Commit a10ba4f

Browse files
vitautfacebook-github-bot
authored andcommitted
Consolidate C++ generator code
Summary: The current directory structure has the following problems: * `lib` is a meaningless directory name since almost everything else in the compiler is also libraries. * `lib` is inconsistent with the rest of the Thrift compiler which is organized by compilation phases (parsing, semantic analysis and generation). * It is confusing because the generator logic is in multiple places, including APIs that are effectively implementation details. Fix it by moving the C++ generator logic from `lib` to `generate` where it belongs. Together with an earlier change this consolidates all C++ generator code which was previously all over the place. Reviewed By: yoney Differential Revision: D64239916 fbshipit-source-id: f35b21fe8df21c8e3917db7e1a93dc5301014020
1 parent 5738576 commit a10ba4f

14 files changed

+14
-14
lines changed

third-party/thrift/src/thrift/compiler/codemod/cppref_to_structured.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <thrift/compiler/ast/t_struct.h>
2222
#include <thrift/compiler/codemod/file_manager.h>
2323
#include <thrift/compiler/compiler.h>
24-
#include <thrift/compiler/lib/cpp2/util.h>
24+
#include <thrift/compiler/generate/cpp/util.h>
2525

2626
using namespace apache::thrift::compiler;
2727

third-party/thrift/src/thrift/compiler/codemod/hoist_annotated_types.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <thrift/compiler/ast/t_struct.h>
2727
#include <thrift/compiler/codemod/file_manager.h>
2828
#include <thrift/compiler/compiler.h>
29-
#include <thrift/compiler/lib/cpp2/util.h>
29+
#include <thrift/compiler/generate/cpp/util.h>
3030

3131
using namespace apache::thrift::compiler;
3232

third-party/thrift/src/thrift/compiler/codemod/specify_implicit_field_id.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <thrift/compiler/ast/t_struct.h>
2626
#include <thrift/compiler/codemod/file_manager.h>
2727
#include <thrift/compiler/compiler.h>
28-
#include <thrift/compiler/lib/cpp2/util.h>
28+
#include <thrift/compiler/generate/cpp/util.h>
2929

3030
using namespace apache::thrift::compiler;
3131

third-party/thrift/src/thrift/compiler/codemod/structure_annotations.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <thrift/compiler/ast/t_struct.h>
2525
#include <thrift/compiler/codemod/file_manager.h>
2626
#include <thrift/compiler/compiler.h>
27-
#include <thrift/compiler/lib/cpp2/util.h>
27+
#include <thrift/compiler/generate/cpp/util.h>
2828
#include <thrift/compiler/lib/uri.h>
2929

3030
using namespace apache::thrift::compiler;

third-party/thrift/src/thrift/compiler/lib/cpp2/util.cc renamed to third-party/thrift/src/thrift/compiler/generate/cpp/util.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <thrift/compiler/lib/cpp2/util.h>
18-
#include "thrift/compiler/ast/t_program.h"
17+
#include <thrift/compiler/generate/cpp/util.h>
1918

2019
#include <algorithm>
2120
#include <functional>
@@ -32,6 +31,7 @@
3231
#include <thrift/compiler/ast/t_list.h>
3332
#include <thrift/compiler/ast/t_map.h>
3433
#include <thrift/compiler/ast/t_node.h>
34+
#include <thrift/compiler/ast/t_program.h>
3535
#include <thrift/compiler/ast/t_set.h>
3636
#include <thrift/compiler/ast/t_struct.h>
3737
#include <thrift/compiler/ast/t_typedef.h>

third-party/thrift/src/thrift/compiler/generate/mstch_objects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include <thrift/compiler/ast/t_program.h>
2929
#include <thrift/compiler/detail/mustache/mstch.h>
30-
#include <thrift/compiler/lib/cpp2/util.h>
30+
#include <thrift/compiler/generate/cpp/util.h>
3131
#include <thrift/compiler/lib/uri.h>
3232
#include <thrift/compiler/sema/sema_context.h>
3333

third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
#include <thrift/compiler/ast/t_field.h>
3232
#include <thrift/compiler/generate/common.h>
3333
#include <thrift/compiler/generate/cpp/name_resolver.h>
34+
#include <thrift/compiler/generate/cpp/util.h>
3435
#include <thrift/compiler/generate/mstch_objects.h>
3536
#include <thrift/compiler/generate/t_mstch_generator.h>
36-
#include <thrift/compiler/lib/cpp2/util.h>
3737
#include <thrift/compiler/lib/schematizer.h>
3838
#include <thrift/compiler/lib/uri.h>
3939
#include <thrift/compiler/sema/ast_validator.h>

third-party/thrift/src/thrift/compiler/generate/t_mstch_py3_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include <thrift/compiler/generate/common.h>
2525
#include <thrift/compiler/generate/cpp/name_resolver.h>
2626
#include <thrift/compiler/generate/cpp/reference_type.h>
27+
#include <thrift/compiler/generate/cpp/util.h>
2728
#include <thrift/compiler/generate/mstch_objects.h>
2829
#include <thrift/compiler/generate/t_mstch_generator.h>
29-
#include <thrift/compiler/lib/cpp2/util.h>
3030
#include <thrift/compiler/lib/py3/util.h>
3131
#include <thrift/compiler/lib/uri.h>
3232

third-party/thrift/src/thrift/compiler/generate/t_mstch_python_capi_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
#include <thrift/compiler/detail/mustache/mstch.h>
3030
#include <thrift/compiler/generate/common.h>
3131
#include <thrift/compiler/generate/cpp/name_resolver.h>
32+
#include <thrift/compiler/generate/cpp/util.h>
3233
#include <thrift/compiler/generate/mstch_objects.h>
3334
#include <thrift/compiler/generate/t_mstch_generator.h>
34-
#include <thrift/compiler/lib/cpp2/util.h>
3535
#include <thrift/compiler/lib/py3/util.h>
3636
#include <thrift/compiler/lib/python/util.h>
3737
#include <thrift/compiler/lib/uri.h>

0 commit comments

Comments
 (0)