diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2012-10-03 19:58:10 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2012-10-03 19:58:10 +0000 |
commit | 9b7dcdb53cee4234c48bb4ceeef39536419945cf (patch) | |
tree | eb370024d6258b6bc5ee015b129e8762b808986f /include | |
parent | fc44e88cbdf013d285f2e4e3962fb80dcad56770 (diff) |
[Options] Store the owning OptTable in Option so it can construct Group and Alias.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Driver/Option.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h index 2adba6b4b7..6fc8bef5da 100644 --- a/include/clang/Driver/Option.h +++ b/include/clang/Driver/Option.h @@ -70,23 +70,17 @@ namespace options { private: const OptTable::Info *Info; - - /// Group this option is a member of, if any. - const Option *Group; - - /// Option that this is an alias for, if any. - const Option *Alias; + const OptTable *Owner; public: - Option(const OptTable::Info *Info, - const Option *Group, const Option *Alias); + Option(const OptTable::Info *Info, const OptTable *Owner); ~Option(); unsigned getID() const { return Info->ID; } OptionClass getKind() const { return OptionClass(Info->Kind); } StringRef getName() const { return Info->Name; } - const Option *getGroup() const { return Group; } - const Option *getAlias() const { return Alias; } + const Option *getGroup() const { return Owner->getOption(Info->GroupID); } + const Option *getAlias() const { return Owner->getOption(Info->AliasID); } unsigned getNumArgs() const { return Info->Param; } @@ -137,6 +131,7 @@ namespace options { /// getUnaliasedOption - Return the final option this option /// aliases (itself, if the option has no alias). const Option *getUnaliasedOption() const { + const Option *Alias = getAlias(); if (Alias) return Alias->getUnaliasedOption(); return this; } |