diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 |
commit | 5a5ac124e1efaf208671f01c46edb15f29ed2a0b (patch) | |
tree | a6140557876943cdd800ee997c9317283394b22c /include/llvm/Option | |
parent | f03b5bed27d0d2eafd68562ce14f8b5e3f1f0801 (diff) |
Diffstat (limited to 'include/llvm/Option')
-rw-r--r-- | include/llvm/Option/Arg.h | 8 | ||||
-rw-r--r-- | include/llvm/Option/ArgList.h | 39 | ||||
-rw-r--r-- | include/llvm/Option/OptSpecifier.h | 4 | ||||
-rw-r--r-- | include/llvm/Option/OptTable.h | 5 | ||||
-rw-r--r-- | include/llvm/Option/Option.h | 1 |
5 files changed, 29 insertions, 28 deletions
diff --git a/include/llvm/Option/Arg.h b/include/llvm/Option/Arg.h index dcaa5405ba7ca..5f6941a53d0c6 100644 --- a/include/llvm/Option/Arg.h +++ b/include/llvm/Option/Arg.h @@ -29,8 +29,8 @@ class ArgList; /// The Arg class encodes just enough information to be able to /// derive the argument values efficiently. class Arg { - Arg(const Arg &) LLVM_DELETED_FUNCTION; - void operator=(const Arg &) LLVM_DELETED_FUNCTION; + Arg(const Arg &) = delete; + void operator=(const Arg &) = delete; private: /// \brief The option this argument is an instance of. @@ -78,9 +78,7 @@ public: const Arg &getBaseArg() const { return BaseArg ? *BaseArg : *this; } - void setBaseArg(const Arg *_BaseArg) { - BaseArg = _BaseArg; - } + void setBaseArg(const Arg *BaseArg) { this->BaseArg = BaseArg; } bool getOwnsValues() const { return OwnsValues; } void setOwnsValues(bool Value) const { OwnsValues = Value; } diff --git a/include/llvm/Option/ArgList.h b/include/llvm/Option/ArgList.h index 3f8547e7fe418..23b04513178c0 100644 --- a/include/llvm/Option/ArgList.h +++ b/include/llvm/Option/ArgList.h @@ -11,7 +11,9 @@ #define LLVM_OPTION_ARGLIST_H #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Twine.h" #include "llvm/Option/OptSpecifier.h" #include "llvm/Option/Option.h" #include <list> @@ -52,10 +54,10 @@ public: typedef std::forward_iterator_tag iterator_category; typedef std::ptrdiff_t difference_type; - arg_iterator(SmallVectorImpl<Arg*>::const_iterator it, - const ArgList &_Args, OptSpecifier _Id0 = 0U, - OptSpecifier _Id1 = 0U, OptSpecifier _Id2 = 0U) - : Current(it), Args(_Args), Id0(_Id0), Id1(_Id1), Id2(_Id2) { + arg_iterator(SmallVectorImpl<Arg *>::const_iterator it, const ArgList &Args, + OptSpecifier Id0 = 0U, OptSpecifier Id1 = 0U, + OptSpecifier Id2 = 0U) + : Current(it), Args(Args), Id0(Id0), Id1(Id1), Id2(Id2) { SkipToNextArg(); } @@ -91,8 +93,8 @@ public: /// and to iterate over groups of arguments. class ArgList { private: - ArgList(const ArgList &) LLVM_DELETED_FUNCTION; - void operator=(const ArgList &) LLVM_DELETED_FUNCTION; + ArgList(const ArgList &) = delete; + void operator=(const ArgList &) = delete; public: typedef SmallVector<Arg*, 16> arglist_type; @@ -188,6 +190,10 @@ public: /// \p Claim Whether the argument should be claimed, if it exists. Arg *getLastArgNoClaim(OptSpecifier Id) const; Arg *getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1) const; + Arg *getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1, + OptSpecifier Id2) const; + Arg *getLastArgNoClaim(OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2, + OptSpecifier Id3) const; Arg *getLastArg(OptSpecifier Id) const; Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1) const; Arg *getLastArg(OptSpecifier Id0, OptSpecifier Id1, OptSpecifier Id2) const; @@ -277,16 +283,13 @@ public: /// @name Arg Synthesis /// @{ - /// MakeArgString - Construct a constant string pointer whose + /// Construct a constant string pointer whose /// lifetime will match that of the ArgList. - virtual const char *MakeArgString(StringRef Str) const = 0; - const char *MakeArgString(const char *Str) const { - return MakeArgString(StringRef(Str)); + virtual const char *MakeArgStringRef(StringRef Str) const = 0; + const char *MakeArgString(const Twine &Str) const { + SmallString<256> Buf; + return MakeArgStringRef(Str.toStringRef(Buf)); } - const char *MakeArgString(std::string Str) const { - return MakeArgString(StringRef(Str)); - } - const char *MakeArgString(const Twine &Str) const; /// \brief Create an arg string for (\p LHS + \p RHS), reusing the /// string at \p Index if possible. @@ -317,7 +320,7 @@ private: public: InputArgList(const char* const *ArgBegin, const char* const *ArgEnd); - ~InputArgList(); + ~InputArgList() override; const char *getArgString(unsigned Index) const override { return ArgStrings[Index]; @@ -336,7 +339,7 @@ public: unsigned MakeIndex(StringRef String0, StringRef String1) const; using ArgList::MakeArgString; - const char *MakeArgString(StringRef Str) const override; + const char *MakeArgStringRef(StringRef Str) const override; /// @} }; @@ -352,7 +355,7 @@ class DerivedArgList : public ArgList { public: /// Construct a new derived arg list from \p BaseArgs. DerivedArgList(const InputArgList &BaseArgs); - ~DerivedArgList(); + ~DerivedArgList() override; const char *getArgString(unsigned Index) const override { return BaseArgs.getArgString(Index); @@ -374,7 +377,7 @@ public: void AddSynthesizedArg(Arg *A); using ArgList::MakeArgString; - const char *MakeArgString(StringRef Str) const override; + const char *MakeArgStringRef(StringRef Str) const override; /// AddFlagArg - Construct a new FlagArg for the given option \p Id and /// append it to the argument list. diff --git a/include/llvm/Option/OptSpecifier.h b/include/llvm/Option/OptSpecifier.h index b7caa6e85a7d6..0b2aaaec3afc8 100644 --- a/include/llvm/Option/OptSpecifier.h +++ b/include/llvm/Option/OptSpecifier.h @@ -21,11 +21,11 @@ namespace opt { unsigned ID; private: - explicit OptSpecifier(bool) LLVM_DELETED_FUNCTION; + explicit OptSpecifier(bool) = delete; public: OptSpecifier() : ID(0) {} - /*implicit*/ OptSpecifier(unsigned _ID) : ID(_ID) {} + /*implicit*/ OptSpecifier(unsigned ID) : ID(ID) {} /*implicit*/ OptSpecifier(const Option *Opt); bool isValid() const { return ID != 0; } diff --git a/include/llvm/Option/OptTable.h b/include/llvm/Option/OptTable.h index 5035940af06ba..a7ff46919cd62 100644 --- a/include/llvm/Option/OptTable.h +++ b/include/llvm/Option/OptTable.h @@ -73,8 +73,9 @@ private: } protected: - OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos, - bool _IgnoreCase = false); + OptTable(const Info *OptionInfos, unsigned NumOptionInfos, + bool IgnoreCase = false); + public: ~OptTable(); diff --git a/include/llvm/Option/Option.h b/include/llvm/Option/Option.h index b2cfacbaf344b..09be26c7cf203 100644 --- a/include/llvm/Option/Option.h +++ b/include/llvm/Option/Option.h @@ -70,7 +70,6 @@ protected: public: Option(const OptTable::Info *Info, const OptTable *Owner); - ~Option(); bool isValid() const { return Info != nullptr; |