diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-03 04:51:00 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-03 04:51:00 +0000 |
commit | 404b9863075145cde48e00b47169e3d0446266b6 (patch) | |
tree | e027cb14e3e099f42838e860cb196438940d7dfb /tools/gn/settings.h | |
parent | 3f2358ec87d2422c790b75e000d4771288089018 (diff) | |
download | chromium_src-404b9863075145cde48e00b47169e3d0446266b6.zip chromium_src-404b9863075145cde48e00b47169e3d0446266b6.tar.gz chromium_src-404b9863075145cde48e00b47169e3d0446266b6.tar.bz2 |
Revert 232657 "GN: toolchain threading cleanup"
Broke linux clang bots:
../../tools/gn/ninja_helper_unittest.cc:20:9:error: field 'settings' will be initialized after field 'toolchain' [-Werror,-Wreorder]
This happened on your try jobs too.
> GN: toolchain threading cleanup
>
> Remove the thread-unsafe toolchain pointer on the otherwise-threadsafe Settings object. I replaced it with the toolchain label, and moved the is_default flag from the toolchain to the Settings object.
>
> This required that I pass the toolchain around in a few more places, but also simplifies some other cases.
>
> I removed the toolchain prefix from Ninja rules for the default toolchain since that's not necessary any more for GYP compat.
>
> This fixes an annoying double-free in the toolchain manager. I think my current refactor will clean this up in a later phase.
>
> R=scottmg@chromium.org
>
> Review URL: https://codereview.chromium.org/51693002
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/46313006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232661 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/settings.h')
-rw-r--r-- | tools/gn/settings.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/gn/settings.h b/tools/gn/settings.h index df6a3d6..1305c58 100644 --- a/tools/gn/settings.h +++ b/tools/gn/settings.h @@ -38,17 +38,18 @@ class Settings { // toolchain's outputs. It should have no slashes in it. The default // toolchain should use an empty string. Settings(const BuildSettings* build_settings, + const Toolchain* toolchain, const std::string& output_subdir_name); ~Settings(); const BuildSettings* build_settings() const { return build_settings_; } - const Label& toolchain_label() const { return toolchain_label_; } - void set_toolchain_label(const Label& l) { toolchain_label_ = l; } - - // Indicates if this corresponds to the default toolchain. - bool is_default() const { return is_default_; } - void set_is_default(bool id) { is_default_ = id; } + // Danger: this must only be used for getting the toolchain label until the + // toolchain has been resolved. Otherwise, it will be modified on an + // arbitrary thread when the toolchain invocation is found. Generally, you + // will only read this from the target generation where we know everything + // has been resolved and won't change. + const Toolchain* toolchain() const { return toolchain_; } bool IsMac() const { return target_os_ == MAC; } bool IsLinux() const { return target_os_ == LINUX; } @@ -93,8 +94,7 @@ class Settings { private: const BuildSettings* build_settings_; - Label toolchain_label_; - bool is_default_; + const Toolchain* toolchain_; TargetOS target_os_; |