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 #ifndef TOOLS_GN_LABEL_PTR_H_ | 5 #ifndef TOOLS_GN_LABEL_PTR_H_ |
6 #define TOOLS_GN_LABEL_PTR_H_ | 6 #define TOOLS_GN_LABEL_PTR_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "tools/gn/label.h" | 10 #include "tools/gn/label.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // This contructor is typically used in unit tests, it extracts the label | 30 // This contructor is typically used in unit tests, it extracts the label |
31 // automatically from a given pointer. | 31 // automatically from a given pointer. |
32 explicit LabelPtrPair(const T* p) : label(p->label()), ptr(p), origin(NULL) { | 32 explicit LabelPtrPair(const T* p) : label(p->label()), ptr(p), origin(NULL) { |
33 } | 33 } |
34 | 34 |
35 ~LabelPtrPair() {} | 35 ~LabelPtrPair() {} |
36 | 36 |
37 Label label; | 37 Label label; |
38 const T* ptr; // May be NULL. | 38 const T* ptr; // May be NULL. |
39 const ParseNode* origin; // May be NULL. | 39 |
| 40 // The origin of this dependency. This will be null for internally generated |
| 41 // dependencies. This happens when a group is automatically expanded and that |
| 42 // group's members are added to the target that depends on that group. |
| 43 const ParseNode* origin; |
40 }; | 44 }; |
41 | 45 |
42 typedef LabelPtrPair<Config> LabelConfigPair; | 46 typedef LabelPtrPair<Config> LabelConfigPair; |
43 typedef LabelPtrPair<Target> LabelTargetPair; | 47 typedef LabelPtrPair<Target> LabelTargetPair; |
44 | 48 |
45 typedef std::vector<LabelConfigPair> LabelConfigVector; | 49 typedef std::vector<LabelConfigPair> LabelConfigVector; |
46 typedef std::vector<LabelTargetPair> LabelTargetVector; | 50 typedef std::vector<LabelTargetPair> LabelTargetVector; |
47 | 51 |
48 // Comparison and search functions --------------------------------------------- | 52 // Comparison and search functions --------------------------------------------- |
49 | 53 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #elif defined(COMPILER_MSVC) | 115 #elif defined(COMPILER_MSVC) |
112 template<typename T> | 116 template<typename T> |
113 inline size_t hash_value(const LabelPtrPair<T>& v) { | 117 inline size_t hash_value(const LabelPtrPair<T>& v) { |
114 return BASE_HASH_NAMESPACE::hash_value(v.label); | 118 return BASE_HASH_NAMESPACE::hash_value(v.label); |
115 } | 119 } |
116 #endif // COMPILER... | 120 #endif // COMPILER... |
117 | 121 |
118 } // namespace BASE_HASH_NAMESPACE | 122 } // namespace BASE_HASH_NAMESPACE |
119 | 123 |
120 #endif // TOOLS_GN_LABEL_PTR_H_ | 124 #endif // TOOLS_GN_LABEL_PTR_H_ |
OLD | NEW |