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/import_manager.h" | 5 #include "tools/gn/import_manager.h" |
6 | 6 |
7 #include "tools/gn/err.h" | 7 #include "tools/gn/err.h" |
8 #include "tools/gn/parse_tree.h" | 8 #include "tools/gn/parse_tree.h" |
9 #include "tools/gn/scheduler.h" | 9 #include "tools/gn/scheduler.h" |
10 #include "tools/gn/scope_per_file_provider.h" | 10 #include "tools/gn/scope_per_file_provider.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Promote the now-read-only scope to outside the load lock. | 104 // Promote the now-read-only scope to outside the load lock. |
105 import_scope = import_info->scope.get(); | 105 import_scope = import_info->scope.get(); |
106 } | 106 } |
107 | 107 |
108 Scope::MergeOptions options; | 108 Scope::MergeOptions options; |
109 options.skip_private_vars = true; | 109 options.skip_private_vars = true; |
110 options.mark_dest_used = true; // Don't require all imported values be used. | 110 options.mark_dest_used = true; // Don't require all imported values be used. |
111 return import_scope->NonRecursiveMergeTo(scope, options, node_for_err, | 111 return import_scope->NonRecursiveMergeTo(scope, options, node_for_err, |
112 "import", err); | 112 "import", err); |
113 } | 113 } |
| 114 |
| 115 std::vector<SourceFile> ImportManager::GetImportedFiles() const { |
| 116 std::vector<SourceFile> imported_files; |
| 117 imported_files.resize(imports_.size()); |
| 118 std::transform(imports_.begin(), imports_.end(), imported_files.begin(), |
| 119 [](const ImportMap::value_type& val) { return val.first; }); |
| 120 return imported_files; |
| 121 } |
OLD | NEW |