Index: tools/gn/commands.cc |
diff --git a/tools/gn/commands.cc b/tools/gn/commands.cc |
index e600872c431c56751a9723cbd7beba07e64f28fc..d40beab011ae1ef3efeff1f35750c56c60eaba10 100644 |
--- a/tools/gn/commands.cc |
+++ b/tools/gn/commands.cc |
@@ -4,7 +4,6 @@ |
#include "tools/gn/commands.h" |
#include "tools/gn/item.h" |
-#include "tools/gn/item_node.h" |
#include "tools/gn/label.h" |
#include "tools/gn/setup.h" |
#include "tools/gn/standard_out.h" |
@@ -52,7 +51,7 @@ const Target* GetTargetForDesc(const std::vector<std::string>& args) { |
if (!setup->DoSetup()) |
return NULL; |
- // FIXME(brettw): set the output dir to be a sandbox one to avoid polluting |
+ // TODO(brettw): set the output dir to be a sandbox one to avoid polluting |
// the real output dir with files written by the build scripts. |
// Do the actual load. This will also write out the target ninja files. |
@@ -62,8 +61,7 @@ const Target* GetTargetForDesc(const std::vector<std::string>& args) { |
// Need to resolve the label after we know the default toolchain. |
// TODO(brettw) find the current directory and resolve the input label |
// relative to that. |
- Label default_toolchain = setup->build_settings().toolchain_manager() |
- .GetDefaultToolchainUnlocked(); |
+ Label default_toolchain = setup->loader()->default_toolchain_label(); |
Value arg_value(NULL, args[0]); |
Err err; |
Label label = |
@@ -73,19 +71,14 @@ const Target* GetTargetForDesc(const std::vector<std::string>& args) { |
return NULL; |
} |
- ItemNode* node; |
- { |
- base::AutoLock lock(setup->build_settings().item_tree().lock()); |
- node = setup->build_settings().item_tree().GetExistingNodeLocked(label); |
- } |
- if (!node) { |
- Err(Location(), "", |
- "I don't know about this \"" + label.GetUserVisibleName(false) + |
- "\"").PrintToStdout(); |
+ const Item* item = setup->builder()->GetItem(label); |
+ if (!item) { |
+ Err(Location(), "Label not found.", |
+ label.GetUserVisibleName(false) + " not found.").PrintToStdout(); |
return NULL; |
} |
- const Target* target = node->item()->AsTarget(); |
+ const Target* target = item->AsTarget(); |
if (!target) { |
Err(Location(), "Not a target.", |
"The \"" + label.GetUserVisibleName(false) + "\" thing\n" |