Skip to content

Commit

Permalink
Revert D67579926: Multisect successfully blamed "D67579926: [thrift] …
Browse files Browse the repository at this point in the history
…Reduce build-time by moving the definition of setter/getter to module_types.cpp (redo)" for one test failure

Summary:
This diff reverts D67579926
D67579926: [thrift] Reduce build-time by moving the definition of setter/getter to module_types.cpp (redo) by Mizuchi causes the following test failure:

Tests affected:
- [cogwheel:cogwheel_genie_llama3_gpu_integration_tests#main](https://www.internalfb.com/intern/test/562950146321539/)

Here's the Multisect link:
https://www.internalfb.com/multisect/18031094
Here are the tasks that are relevant to this breakage:
T191382983: 10+ tests unhealthy for gen_ai_training

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

Reviewed By: Mizuchi

Differential Revision: D67621363

fbshipit-source-id: 04da22c58bc91bdcd542c9b76842fa0a8985c563
  • Loading branch information
generatedunixname89002005232357 authored and facebook-github-bot committed Dec 25, 2024
1 parent 3c4a786 commit b3faa6e
Show file tree
Hide file tree
Showing 135 changed files with 5,050 additions and 7,277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,26 @@
limitations under the License.
}}{{#struct:fields?}}{{#struct:fields}}{{#field:type}}{{#field:has_deprecated_accessors?}}
{{#if field:optional?}}

{{#type:resolves_to_container_or_struct?}}
{{#field:optional?}}
const {{type:cpp_type}}* {{struct:cpp_underlying_name}}::get_{{field:cpp_name}}() const& {
return {{field:cpp_name}}_ref().has_value() ? std::addressof({{field:cpp_storage_name}}) : nullptr;
}

{{type:cpp_type}}* {{struct:cpp_underlying_name}}::get_{{field:cpp_name}}() & {
return {{field:cpp_name}}_ref().has_value() ? std::addressof({{field:cpp_storage_name}}) : nullptr;
}
{{#else}}
{{#if type:resolves_to_fixed_size?}}

{{type:cpp_type}} {{struct:cpp_underlying_name}}::get_{{field:cpp_name}}() const {
return {{field:cpp_storage_name}};
}
{{#else}}

{{/field:optional?}}
{{^field:optional?}}
const {{type:cpp_type}}& {{struct:cpp_underlying_name}}::get_{{field:cpp_name}}() const& {
return {{field:cpp_storage_name}};
}

{{type:cpp_type}} {{struct:cpp_underlying_name}}::get_{{field:cpp_name}}() && {
return static_cast<{{type:cpp_type}}&&>({{field:cpp_storage_name}});
return std::move({{field:cpp_storage_name}});
}
{{/if type:resolves_to_fixed_size?}}
{{/if field:optional?}}
{{#if type:resolves_to_fixed_size?}}

{{type:cpp_type}}& {{struct:cpp_underlying_name}}::set_{{field:cpp_name}}({{type:cpp_type}} {{field:cpp_name}}_) {
{{field:cpp_name}}_ref() = {{field:cpp_name}}_;
return {{field:cpp_storage_name}};
}
{{/if type:resolves_to_fixed_size?}}
{{/field:optional?}}
{{/type:resolves_to_container_or_struct?}}
{{/field:has_deprecated_accessors?}}{{/field:type}}{{/struct:fields}}{{/struct:fields?}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,81 @@
limitations under the License.
}}{{#struct:fields}}{{#field:type}}{{#field:has_deprecated_accessors?}}
{{^type:resolves_to_container_or_struct?}}
{{#if field:optional?}}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
const {{type:cpp_type}}* get_{{field:cpp_name}}() const&;
const {{type:cpp_type}}* get_{{field:cpp_name}}() const& {
return {{field:cpp_name}}_ref().has_value() ? std::addressof({{field:cpp_storage_name}}) : nullptr;
}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}}* get_{{field:cpp_name}}() &;
{{type:cpp_type}}* get_{{field:cpp_name}}() & {
return {{field:cpp_name}}_ref().has_value() ? std::addressof({{field:cpp_storage_name}}) : nullptr;
}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}}* get_{{field:cpp_name}}() && = delete;
{{#else}}
{{#if type:resolves_to_fixed_size?}}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}} get_{{field:cpp_name}}() const;
{{type:cpp_type}} get_{{field:cpp_name}}() const {
return {{field:cpp_storage_name}};
}
{{#else}}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
const {{type:cpp_type}}& get_{{field:cpp_name}}() const&;
const {{type:cpp_type}}& get_{{field:cpp_name}}() const& {
return {{field:cpp_storage_name}};
}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}} get_{{field:cpp_name}}() &&;
{{type:cpp_type}} get_{{field:cpp_name}}() && {
return std::move({{field:cpp_storage_name}});
}
{{/if type:resolves_to_fixed_size?}}
{{/if field:optional?}}
{{/type:resolves_to_container_or_struct?}}
{{#type:resolves_to_container_or_struct?}}
{{#if field:optional?}}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
const {{type:cpp_type}}* get_{{field:cpp_name}}() const&;

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}}* get_{{field:cpp_name}}() &;

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}}* get_{{field:cpp_name}}() && = delete;
{{#else}}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
const {{type:cpp_type}}& get_{{field:cpp_name}}() const&;

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}().value();` instead of `FOO.get_{{field:cpp_name}}();`")]]
{{type:cpp_type}} get_{{field:cpp_name}}() &&;
{{/if field:optional?}}
{{/type:resolves_to_container_or_struct?}}
{{#if type:resolves_to_fixed_size?}}

{{> common/field_docblock}}
[[deprecated("Use `FOO.{{field:cpp_name}}() = BAR;` instead of `FOO.set_{{field:cpp_name}}(BAR);`")]]
{{type:cpp_type}}& set_{{field:cpp_name}}({{type:cpp_type}} {{field:cpp_name}}_);
{{type:cpp_type}}& set_{{field:cpp_name}}({{type:cpp_type}} {{field:cpp_name}}_) {
{{field:cpp_name}}_ref() = {{field:cpp_name}}_;
return {{field:cpp_storage_name}};
}
{{#else}}

{{> common/field_docblock}}
Expand Down
Loading

0 comments on commit b3faa6e

Please sign in to comment.