diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-18 22:42:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-18 22:42:31 +0000 |
commit | f38523388174760dcbad810ef60d8504d7df6b4c (patch) | |
tree | 336884232711ddc238e70b9acca37f23e12bda96 /lib/Driver/Option.cpp | |
parent | 25dfaacde51df0834f10e3ab1646e6de9e229788 (diff) |
Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.
This seems to have introduced assertion hit when building compiler-rt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Option.cpp')
-rw-r--r-- | lib/Driver/Option.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp index 116dbca5b0..117021b880 100644 --- a/lib/Driver/Option.cpp +++ b/lib/Driver/Option.cpp @@ -23,8 +23,7 @@ Option::Option(const OptTable::Info *info, const OptTable *owner) // Multi-level aliases are not supported, and alias options cannot // have groups. This just simplifies option tracking, it is not an // inherent limitation. - assert(!Info || (!getAlias().isValid() || (!getAlias().getAlias().isValid() && - !getGroup().isValid())) && + assert((!getAlias() || (!getAlias()->getAlias() && !getGroup())) && "Multi-level aliases and aliases with groups are unsupported."); } @@ -50,16 +49,16 @@ void Option::dump() const { llvm::errs() << " Name:\"" << getName() << '"'; - const Option Group = getGroup(); - if (Group.isValid()) { + const Option *Group = getGroup(); + if (Group) { llvm::errs() << " Group:"; - Group.dump(); + Group->dump(); } - const Option Alias = getAlias(); - if (Alias.isValid()) { + const Option *Alias = getAlias(); + if (Alias) { llvm::errs() << " Alias:"; - Alias.dump(); + Alias->dump(); } if (getKind() == MultiArgClass) @@ -70,17 +69,17 @@ void Option::dump() const { bool Option::matches(OptSpecifier Opt) const { // Aliases are never considered in matching, look through them. - const Option Alias = getAlias(); - if (Alias.isValid()) - return Alias.matches(Opt); + const Option *Alias = getAlias(); + if (Alias) + return Alias->matches(Opt); // Check exact match. if (getID() == Opt.getID()) return true; - const Option Group = getGroup(); - if (Group.isValid()) - return Group.matches(Opt); + const Option *Group = getGroup(); + if (Group) + return Group->matches(Opt); return false; } @@ -156,7 +155,7 @@ Arg *Option::accept(const ArgList &Args, unsigned &Index) const { // FIXME: Avoid strlen. if (getName().size() != strlen(Args.getArgString(Index))) { const char *Value = Args.getArgString(Index) + getName().size(); - return new Arg(*this, Index++, Value); + return new Arg(this, Index++, Value); } // Otherwise it must be separate. |