OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/gn/toolchain.h" | 5 #include "tools/gn/toolchain.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 NOTREACHED(); | 84 NOTREACHED(); |
85 return std::string(); | 85 return std::string(); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 const Tool* Toolchain::GetTool(ToolType type) const { | 89 const Tool* Toolchain::GetTool(ToolType type) const { |
90 DCHECK(type != TYPE_NONE); | 90 DCHECK(type != TYPE_NONE); |
91 return tools_[static_cast<size_t>(type)].get(); | 91 return tools_[static_cast<size_t>(type)].get(); |
92 } | 92 } |
93 | 93 |
94 void Toolchain::SetTool(ToolType type, scoped_ptr<Tool> t) { | 94 void Toolchain::SetTool(ToolType type, std::unique_ptr<Tool> t) { |
95 DCHECK(type != TYPE_NONE); | 95 DCHECK(type != TYPE_NONE); |
96 DCHECK(!tools_[type].get()); | 96 DCHECK(!tools_[type].get()); |
97 t->SetComplete(); | 97 t->SetComplete(); |
98 tools_[type] = std::move(t); | 98 tools_[type] = std::move(t); |
99 } | 99 } |
100 | 100 |
101 void Toolchain::ToolchainSetupComplete() { | 101 void Toolchain::ToolchainSetupComplete() { |
102 // Collect required bits from all tools. | 102 // Collect required bits from all tools. |
103 for (const auto& tool : tools_) { | 103 for (const auto& tool : tools_) { |
104 if (tool) | 104 if (tool) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return TYPE_STAMP; | 165 return TYPE_STAMP; |
166 default: | 166 default: |
167 NOTREACHED(); | 167 NOTREACHED(); |
168 return Toolchain::TYPE_NONE; | 168 return Toolchain::TYPE_NONE; |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 const Tool* Toolchain::GetToolForTargetFinalOutput(const Target* target) const { | 172 const Tool* Toolchain::GetToolForTargetFinalOutput(const Target* target) const { |
173 return tools_[GetToolTypeForTargetFinalOutput(target)].get(); | 173 return tools_[GetToolTypeForTargetFinalOutput(target)].get(); |
174 } | 174 } |
OLD | NEW |