Skip to content
Snippets Groups Projects
Commit fc7c677c authored by James Dennett's avatar James Dennett
Browse files

Documentation cleanup:

* Added file header documentation with \file and \brief;
* Cleaned up existing doc comments and added/annotated \brief summaries.

llvm-svn: 159629
parent 0bb4164c
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
// License. See LICENSE.TXT for details. // License. See LICENSE.TXT for details.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
///
/// \file
/// \brief Defines the clang::driver::Arg class for parsed arguments.
///
//===----------------------------------------------------------------------===//
#ifndef CLANG_DRIVER_ARG_H_ #ifndef CLANG_DRIVER_ARG_H_
#define CLANG_DRIVER_ARG_H_ #define CLANG_DRIVER_ARG_H_
...@@ -20,7 +25,7 @@ namespace driver { ...@@ -20,7 +25,7 @@ namespace driver {
class ArgList; class ArgList;
class Option; class Option;
/// Arg - A concrete instance of a particular driver option. /// \brief A concrete instance of a particular driver option.
/// ///
/// The Arg class encodes just enough information to be able to /// The Arg class encodes just enough information to be able to
/// derive the argument values efficiently. In addition, Arg /// derive the argument values efficiently. In addition, Arg
...@@ -32,25 +37,26 @@ namespace driver { ...@@ -32,25 +37,26 @@ namespace driver {
void operator=(const Arg &); // DO NOT IMPLEMENT void operator=(const Arg &); // DO NOT IMPLEMENT
private: private:
/// The option this argument is an instance of. /// \brief The option this argument is an instance of.
const Option *Opt; const Option *Opt;
/// The argument this argument was derived from (during tool chain /// \brief The argument this argument was derived from (during tool chain
/// argument translation), if any. /// argument translation), if any.
const Arg *BaseArg; const Arg *BaseArg;
/// The index at which this argument appears in the containing /// \brief The index at which this argument appears in the containing
/// ArgList. /// ArgList.
unsigned Index; unsigned Index;
/// Was this argument used to effect compilation; used for generating /// \brief Was this argument used to effect compilation?
/// "argument unused" diagnostics. ///
/// This is used for generating "argument unused" diagnostics.
mutable unsigned Claimed : 1; mutable unsigned Claimed : 1;
/// Does this argument own its values. /// \brief Does this argument own its values?
mutable unsigned OwnsValues : 1; mutable unsigned OwnsValues : 1;
/// The argument values, as C strings. /// \brief The argument values, as C strings.
SmallVector<const char *, 2> Values; SmallVector<const char *, 2> Values;
public: public:
...@@ -64,8 +70,9 @@ namespace driver { ...@@ -64,8 +70,9 @@ namespace driver {
const Option &getOption() const { return *Opt; } const Option &getOption() const { return *Opt; }
unsigned getIndex() const { return Index; } unsigned getIndex() const { return Index; }
/// getBaseArg - Return the base argument which generated this /// \brief Return the base argument which generated this arg.
/// arg; this is either the argument itself or the argument it was ///
/// This is either the argument itself or the argument it was
/// derived from during tool chain specific argument translation. /// derived from during tool chain specific argument translation.
const Arg &getBaseArg() const { const Arg &getBaseArg() const {
return BaseArg ? *BaseArg : *this; return BaseArg ? *BaseArg : *this;
...@@ -79,7 +86,7 @@ namespace driver { ...@@ -79,7 +86,7 @@ namespace driver {
bool isClaimed() const { return getBaseArg().Claimed; } bool isClaimed() const { return getBaseArg().Claimed; }
/// claim - Set the Arg claimed bit. /// \brief Set the Arg claimed bit.
void claim() const { getBaseArg().Claimed = true; } void claim() const { getBaseArg().Claimed = true; }
unsigned getNumValues() const { return Values.size(); } unsigned getNumValues() const { return Values.size(); }
...@@ -98,20 +105,21 @@ namespace driver { ...@@ -98,20 +105,21 @@ namespace driver {
return false; return false;
} }
/// render - Append the argument onto the given array as strings. /// \brief Append the argument onto the given array as strings.
void render(const ArgList &Args, ArgStringList &Output) const; void render(const ArgList &Args, ArgStringList &Output) const;
/// renderAsInput - Append the argument, render as an input, onto /// \brief Append the argument, render as an input, onto the given
/// the given array as strings. The distinction is that some /// array as strings.
/// options only render their values when rendered as a input ///
/// (e.g., Xlinker). /// The distinction is that some options only render their values
/// when rendered as a input (e.g., Xlinker).
void renderAsInput(const ArgList &Args, ArgStringList &Output) const; void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
static bool classof(const Arg *) { return true; } static bool classof(const Arg *) { return true; }
void dump() const; void dump() const;
/// getAsString - Return a formatted version of the argument and /// \brief Return a formatted version of the argument and
/// its values, for debugging and diagnostics. /// its values, for debugging and diagnostics.
std::string getAsString(const ArgList &Args) const; std::string getAsString(const ArgList &Args) const;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment