Index: tools/gn/substitution_pattern.h |
diff --git a/tools/gn/substitution_pattern.h b/tools/gn/substitution_pattern.h |
index 70fc5eb375a00e4fcc909feaa0d648c9a62e7ea9..7e6c662519ad4518b25961480f1d298418e036ae 100644 |
--- a/tools/gn/substitution_pattern.h |
+++ b/tools/gn/substitution_pattern.h |
@@ -10,6 +10,7 @@ |
#include "tools/gn/substitution_type.h" |
+class BuildSettings; |
class Err; |
class ParseNode; |
class Value; |
@@ -22,6 +23,10 @@ class SubstitutionPattern { |
Subrange(SubstitutionType t, const std::string& l = std::string()); |
~Subrange(); |
+ inline bool operator==(const Subrange& other) const { |
+ return type == other.type && literal == other.literal; |
+ } |
+ |
SubstitutionType type; |
// When type_ == LITERAL, this specifies the literal. |
@@ -41,7 +46,13 @@ class SubstitutionPattern { |
// Sets the bits in the given vector corresponding to the substitutions used |
// by this pattern. SUBSTITUTION_LITERAL is ignored. |
- void FillRequiredTypes(bool required_types[SUBSTITUTION_NUM_TYPES]) const; |
+ void FillRequiredTypes(SubstitutionBits* bits) const; |
+ |
+ // Checks whether this pattern resolves to something in the output directory |
+ // for the given build settings. If not, returns false and fills in the given |
+ // error. |
+ bool IsInOutputDir(const BuildSettings* build_settings, |
+ Err* err) const; |
// Returns a vector listing the substitutions used by this pattern, not |
// counting SUBSTITUTION_LITERAL. |
@@ -54,6 +65,7 @@ class SubstitutionPattern { |
private: |
std::vector<Subrange> ranges_; |
+ const ParseNode* origin_; |
std::vector<SubstitutionType> required_types_; |
}; |