diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 13:13:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 13:13:10 +0000 |
commit | 9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a (patch) | |
tree | b466a4817f79516eb1df8eae92bccf62ecc84003 /contrib/llvm/lib/Option/Option.cpp | |
parent | f09a28d1de99fda4f5517fb12670fc36552f4927 (diff) | |
parent | e194cd6d03d91631334d9d5e55b506036f423cc8 (diff) | |
download | FreeBSD-src-9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a.zip FreeBSD-src-9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a.tar.gz |
Update llvm to trunk r256633.
Diffstat (limited to 'contrib/llvm/lib/Option/Option.cpp')
-rw-r--r-- | contrib/llvm/lib/Option/Option.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/contrib/llvm/lib/Option/Option.cpp b/contrib/llvm/lib/Option/Option.cpp index 221414d..ebf05aa 100644 --- a/contrib/llvm/lib/Option/Option.cpp +++ b/contrib/llvm/lib/Option/Option.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/Twine.h" #include "llvm/Option/Arg.h" #include "llvm/Option/ArgList.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> @@ -35,10 +36,10 @@ Option::Option(const OptTable::Info *info, const OptTable *owner) } } -void Option::dump() const { - llvm::errs() << "<"; +void Option::print(raw_ostream &O) const { + O << "<"; switch (getKind()) { -#define P(N) case N: llvm::errs() << #N; break +#define P(N) case N: O << #N; break P(GroupClass); P(InputClass); P(UnknownClass); @@ -54,33 +55,35 @@ void Option::dump() const { } if (Info->Prefixes) { - llvm::errs() << " Prefixes:["; - for (const char * const *Pre = Info->Prefixes; *Pre != nullptr; ++Pre) { - llvm::errs() << '"' << *Pre << (*(Pre + 1) == nullptr ? "\"" : "\", "); + O << " Prefixes:["; + for (const char *const *Pre = Info->Prefixes; *Pre != nullptr; ++Pre) { + O << '"' << *Pre << (*(Pre + 1) == nullptr ? "\"" : "\", "); } - llvm::errs() << ']'; + O << ']'; } - llvm::errs() << " Name:\"" << getName() << '"'; + O << " Name:\"" << getName() << '"'; const Option Group = getGroup(); if (Group.isValid()) { - llvm::errs() << " Group:"; - Group.dump(); + O << " Group:"; + Group.print(O); } const Option Alias = getAlias(); if (Alias.isValid()) { - llvm::errs() << " Alias:"; - Alias.dump(); + O << " Alias:"; + Alias.print(O); } if (getKind() == MultiArgClass) - llvm::errs() << " NumArgs:" << getNumArgs(); + O << " NumArgs:" << getNumArgs(); - llvm::errs() << ">\n"; + O << ">\n"; } +void Option::dump() const { print(dbgs()); } + bool Option::matches(OptSpecifier Opt) const { // Aliases are never considered in matching, look through them. const Option Alias = getAlias(); |