diff options
Diffstat (limited to 'include/mcld/Support/CommandLine.h')
-rw-r--r-- | include/mcld/Support/CommandLine.h | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/include/mcld/Support/CommandLine.h b/include/mcld/Support/CommandLine.h index 1801354..8c10b91 100644 --- a/include/mcld/Support/CommandLine.h +++ b/include/mcld/Support/CommandLine.h @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -#ifndef MCLD_SUPPORT_COMMANDLINE_H -#define MCLD_SUPPORT_COMMANDLINE_H -#include <mcld/Support/FileSystem.h> -#include <mcld/MC/ZOption.h> +#ifndef MCLD_SUPPORT_COMMANDLINE_H_ +#define MCLD_SUPPORT_COMMANDLINE_H_ +#include "mcld/MC/ZOption.h" +#include "mcld/Support/FileSystem.h" #include <llvm/ADT/StringRef.h> #include <llvm/ADT/Triple.h> @@ -23,18 +23,17 @@ namespace cl { //===----------------------------------------------------------------------===// // SearchDirParser //===----------------------------------------------------------------------===// -class SearchDirParser : public llvm::cl::basic_parser<std::string> -{ -public: +class SearchDirParser : public llvm::cl::basic_parser<std::string> { + public: // parse - Return true on error. - bool parse(Option &pOption, + bool parse(Option& pOption, StringRef pArgName, StringRef pArg, - std::string &pValue); + std::string& pValue); - const char *getValueName() const { return "searchdir"; } + const char* getValueName() const { return "searchdir"; } - void printOptionDiff(const Option &pOption, + void printOptionDiff(const Option& pOption, StringRef pValue, OptVal pDefault, size_t pGlobalWidth) const; @@ -45,11 +44,10 @@ public: //===----------------------------------------------------------------------===// // FalseParser //===----------------------------------------------------------------------===// -class FalseParser : public cl::parser<bool> -{ -public: +class FalseParser : public cl::parser<bool> { + public: // parse - Return true on error. - bool parse(cl::Option &O, StringRef ArgName, StringRef Arg, bool &Val) { + bool parse(cl::Option& O, StringRef ArgName, StringRef Arg, bool& Val) { if (cl::parser<bool>::parse(O, ArgName, Arg, Val)) return false; Val = false; @@ -60,18 +58,17 @@ public: //===----------------------------------------------------------------------===// // parser<mcld::sys::fs::Path> //===----------------------------------------------------------------------===// -template<> -class parser<mcld::sys::fs::Path> : public basic_parser<mcld::sys::fs::Path> -{ -public: - bool parse(Option &O, +template <> +class parser<mcld::sys::fs::Path> : public basic_parser<mcld::sys::fs::Path> { + public: + bool parse(Option& O, StringRef ArgName, StringRef Arg, - mcld::sys::fs::Path &Val); + mcld::sys::fs::Path& Val); - virtual const char *getValueName() const { return "path"; } - void printOptionDiff(const Option &O, - const mcld::sys::fs::Path &V, + virtual const char* getValueName() const { return "path"; } + void printOptionDiff(const Option& O, + const mcld::sys::fs::Path& V, OptVal Default, size_t GlobalWidth) const; virtual void anchor(); @@ -80,22 +77,20 @@ public: //===----------------------------------------------------------------------===// // parser<mcld::ZOption> //===----------------------------------------------------------------------===// -template<> -class parser<mcld::ZOption> : public llvm::cl::basic_parser<mcld::ZOption> -{ -public: - bool parse(Option &O, StringRef ArgName, StringRef Arg, mcld::ZOption &Val); +template <> +class parser<mcld::ZOption> : public llvm::cl::basic_parser<mcld::ZOption> { + public: + bool parse(Option& O, StringRef ArgName, StringRef Arg, mcld::ZOption& Val); - virtual const char *getValueName() const { return "z-option"; } - void printOptionDiff(const Option &O, - const mcld::ZOption &V, + virtual const char* getValueName() const { return "z-option"; } + void printOptionDiff(const Option& O, + const mcld::ZOption& V, OptVal Default, size_t GlobalWidth) const; virtual void anchor(); }; -} // namespace of cl -} // namespace of llvm - -#endif +} // namespace cl +} // namespace llvm +#endif // MCLD_SUPPORT_COMMANDLINE_H_ |