X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=inline;f=include%2Fllvm%2FOption%2FArg.h;h=99d329693de2e7888bcd979d5055f8b0a26660ff;hb=96e80fcbfd852a6bc6ed1a15c87e709ac1080dbc;hp=6b8ed3f7d2b114d65f98c3a10c9cfb589f836b51;hpb=674be02d525d4e24bc6943ed9274958c580bcfbc;p=oota-llvm.git diff --git a/include/llvm/Option/Arg.h b/include/llvm/Option/Arg.h index 6b8ed3f7d2b..99d329693de 100644 --- a/include/llvm/Option/Arg.h +++ b/include/llvm/Option/Arg.h @@ -27,13 +27,10 @@ class ArgList; /// \brief A concrete instance of a particular driver option. /// /// The Arg class encodes just enough information to be able to -/// derive the argument values efficiently. In addition, Arg -/// instances have an intrusive double linked list which is used by -/// ArgList to provide efficient iteration over all instances of a -/// particular option. +/// 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. @@ -63,14 +60,14 @@ private: public: Arg(const Option Opt, StringRef Spelling, unsigned Index, - const Arg *BaseArg = 0); + const Arg *BaseArg = nullptr); Arg(const Option Opt, StringRef Spelling, unsigned Index, - const char *Value0, const Arg *BaseArg = 0); + const char *Value0, const Arg *BaseArg = nullptr); Arg(const Option Opt, StringRef Spelling, unsigned Index, - const char *Value0, const char *Value1, const Arg *BaseArg = 0); + const char *Value0, const char *Value1, const Arg *BaseArg = nullptr); ~Arg(); - const Option getOption() const { return Opt; } + const Option &getOption() const { return Opt; } StringRef getSpelling() const { return Spelling; } unsigned getIndex() const { return Index; } @@ -81,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; } @@ -98,9 +93,8 @@ public: return Values[N]; } - SmallVectorImpl &getValues() { - return Values; - } + SmallVectorImpl &getValues() { return Values; } + const SmallVectorImpl &getValues() const { return Values; } bool containsValue(StringRef Value) const { for (unsigned i = 0, e = getNumValues(); i != e; ++i) @@ -119,6 +113,7 @@ public: /// when rendered as a input (e.g., Xlinker). void renderAsInput(const ArgList &Args, ArgStringList &Output) const; + void print(raw_ostream &O) const; void dump() const; /// \brief Return a formatted version of the argument and