aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Driver/Option.h4
-rw-r--r--lib/Driver/Option.cpp9
2 files changed, 6 insertions, 7 deletions
diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h
index caf94e9d2c..3c6961e71b 100644
--- a/include/clang/Driver/Option.h
+++ b/include/clang/Driver/Option.h
@@ -136,6 +136,10 @@ namespace driver {
/// matches - Predicate for whether this option is part of the
/// given option (which may be a group).
+ ///
+ /// Note that matches against options which are an alias should never be
+ /// done -- aliases do not participate in matching and so such a query will
+ /// always be false.
bool matches(const Option *Opt) const;
bool matches(unsigned Id) const;
diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp
index 7dc81d8e51..47a0652965 100644
--- a/lib/Driver/Option.cpp
+++ b/lib/Driver/Option.cpp
@@ -71,9 +71,7 @@ void Option::dump() const {
}
bool Option::matches(const Option *Opt) const {
- // Aliases are never considered in matching.
- if (Opt->getAlias())
- return matches(Opt->getAlias());
+ // Aliases are never considered in matching, look through them.
if (Alias)
return Alias->matches(Opt);
@@ -86,10 +84,7 @@ bool Option::matches(const Option *Opt) const {
}
bool Option::matches(unsigned Id) const {
- // FIXME: Decide what to do here; we should either pull out the
- // handling of alias on the option for Id from the other matches, or
- // find some other solution (which hopefully doesn't require using
- // the option table).
+ // Aliases are never considered in matching, look through them.
if (Alias)
return Alias->matches(Id);