Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: tools/gn/functions.cc

Issue 2940873002: Implement tracking of BUILD.gn files used to define target, toolchain or (Closed)
Patch Set: Fix compilation after rebase. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/function_toolchain.cc ('k') | tools/gn/header_checker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/functions.h" 5 #include "tools/gn/functions.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <iostream> 8 #include <iostream>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (!EnsureSingleStringArg(function, args, err) || 330 if (!EnsureSingleStringArg(function, args, err) ||
331 !EnsureNotProcessingImport(function, scope, err)) 331 !EnsureNotProcessingImport(function, scope, err))
332 return Value(); 332 return Value();
333 333
334 Label label(MakeLabelForScope(scope, function, args[0].string_value())); 334 Label label(MakeLabelForScope(scope, function, args[0].string_value()));
335 335
336 if (g_scheduler->verbose_logging()) 336 if (g_scheduler->verbose_logging())
337 g_scheduler->Log("Defining config", label.GetUserVisibleName(true)); 337 g_scheduler->Log("Defining config", label.GetUserVisibleName(true));
338 338
339 // Create the new config. 339 // Create the new config.
340 std::unique_ptr<Config> config(new Config(scope->settings(), label)); 340 std::unique_ptr<Config> config(
341 new Config(scope->settings(), label, scope->input_files()));
341 config->set_defined_from(function); 342 config->set_defined_from(function);
342 if (!Visibility::FillItemVisibility(config.get(), scope, err)) 343 if (!Visibility::FillItemVisibility(config.get(), scope, err))
343 return Value(); 344 return Value();
344 345
345 // Fill the flags and such. 346 // Fill the flags and such.
346 const SourceDir& input_dir = scope->GetSourceDir(); 347 const SourceDir& input_dir = scope->GetSourceDir();
347 ConfigValuesGenerator gen(&config->own_values(), scope, input_dir, err); 348 ConfigValuesGenerator gen(&config->own_values(), scope, input_dir, err);
348 gen.Run(); 349 gen.Run();
349 if (err->has_error()) 350 if (err->has_error())
350 return Value(); 351 return Value();
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 902
902 if (!depth->VerifyTypeIs(Value::INTEGER, err)) 903 if (!depth->VerifyTypeIs(Value::INTEGER, err))
903 return Value(); 904 return Value();
904 905
905 if (depth->int_value() < 0) { 906 if (depth->int_value() < 0) {
906 *err = Err(function, "depth must be positive or nul."); 907 *err = Err(function, "depth must be positive or nul.");
907 return Value(); 908 return Value();
908 } 909 }
909 910
910 // Create the new pool. 911 // Create the new pool.
911 std::unique_ptr<Pool> pool(new Pool(scope->settings(), label)); 912 std::unique_ptr<Pool> pool(
913 new Pool(scope->settings(), label, scope->input_files()));
912 pool->set_depth(depth->int_value()); 914 pool->set_depth(depth->int_value());
913 915
914 // Save the generated item. 916 // Save the generated item.
915 Scope::ItemVector* collector = scope->GetItemCollector(); 917 Scope::ItemVector* collector = scope->GetItemCollector();
916 if (!collector) { 918 if (!collector) {
917 *err = Err(function, "Can't define a pool in this context."); 919 *err = Err(function, "Can't define a pool in this context.");
918 return Value(); 920 return Value();
919 } 921 }
920 collector->push_back(pool.release()); 922 collector->push_back(pool.release());
921 923
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 } 1256 }
1255 1257
1256 // Otherwise it's a no-block function. 1258 // Otherwise it's a no-block function.
1257 if (!VerifyNoBlockForFunctionCall(function, block, err)) 1259 if (!VerifyNoBlockForFunctionCall(function, block, err))
1258 return Value(); 1260 return Value();
1259 return found_function->second.no_block_runner(scope, function, 1261 return found_function->second.no_block_runner(scope, function,
1260 args.list_value(), err); 1262 args.list_value(), err);
1261 } 1263 }
1262 1264
1263 } // namespace functions 1265 } // namespace functions
OLDNEW
« no previous file with comments | « tools/gn/function_toolchain.cc ('k') | tools/gn/header_checker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698