aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Driver/Arg.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /include/clang/Driver/Arg.h
parent657bc3d9848e3be92029b2416031340988cd0111 (diff)
downloadsrc-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.tar.gz
src-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.zip
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):vendor/clang/clang-release_32-r168974
Notes
Notes: svn path=/vendor/clang/dist/; revision=243791 svn path=/vendor/clang/clang-release_32-r168974/; revision=243792; tag=vendor/clang/clang-release_32-r168974
Diffstat (limited to 'include/clang/Driver/Arg.h')
-rw-r--r--include/clang/Driver/Arg.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/include/clang/Driver/Arg.h b/include/clang/Driver/Arg.h
index e466cc323173..3b3829a634a0 100644
--- a/include/clang/Driver/Arg.h
+++ b/include/clang/Driver/Arg.h
@@ -15,6 +15,8 @@
#ifndef CLANG_DRIVER_ARG_H_
#define CLANG_DRIVER_ARG_H_
+#include "clang/Driver/Option.h"
+
#include "Util.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
@@ -23,7 +25,6 @@
namespace clang {
namespace driver {
class ArgList;
- class Option;
/// \brief A concrete instance of a particular driver option.
///
@@ -33,17 +34,20 @@ namespace driver {
/// ArgList to provide efficient iteration over all instances of a
/// particular option.
class Arg {
- Arg(const Arg &); // DO NOT IMPLEMENT
- void operator=(const Arg &); // DO NOT IMPLEMENT
+ Arg(const Arg &) LLVM_DELETED_FUNCTION;
+ void operator=(const Arg &) LLVM_DELETED_FUNCTION;
private:
/// \brief The option this argument is an instance of.
- const Option *Opt;
+ const Option Opt;
/// \brief The argument this argument was derived from (during tool chain
/// argument translation), if any.
const Arg *BaseArg;
+ /// \brief How this instance of the option was spelled.
+ StringRef Spelling;
+
/// \brief The index at which this argument appears in the containing
/// ArgList.
unsigned Index;
@@ -60,14 +64,16 @@ namespace driver {
SmallVector<const char *, 2> Values;
public:
- Arg(const Option *Opt, unsigned Index, const Arg *BaseArg = 0);
- Arg(const Option *Opt, unsigned Index,
+ Arg(const Option Opt, StringRef Spelling, unsigned Index,
+ const Arg *BaseArg = 0);
+ Arg(const Option Opt, StringRef Spelling, unsigned Index,
const char *Value0, const Arg *BaseArg = 0);
- Arg(const Option *Opt, unsigned Index,
+ Arg(const Option Opt, StringRef Spelling, unsigned Index,
const char *Value0, const char *Value1, const Arg *BaseArg = 0);
~Arg();
- const Option &getOption() const { return *Opt; }
+ const Option getOption() const { return Opt; }
+ StringRef getSpelling() const { return Spelling; }
unsigned getIndex() const { return Index; }
/// \brief Return the base argument which generated this arg.
@@ -90,7 +96,7 @@ namespace driver {
void claim() const { getBaseArg().Claimed = true; }
unsigned getNumValues() const { return Values.size(); }
- const char *getValue(const ArgList &Args, unsigned N=0) const {
+ const char *getValue(unsigned N = 0) const {
return Values[N];
}
@@ -115,8 +121,6 @@ namespace driver {
/// when rendered as a input (e.g., Xlinker).
void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
- static bool classof(const Arg *) { return true; }
-
void dump() const;
/// \brief Return a formatted version of the argument and