/// example of reading the above option would be:
///
/// ScalarizeLoadStore =
-/// M.getContext().template getOption<bool,
-/// Scalarizer,
-/// &Scalarizer::ScalarizeLoadStore>();
+/// M.getContext().getOption<bool,
+/// Scalarizer,
+/// &Scalarizer::ScalarizeLoadStore>();
///
//===----------------------------------------------------------------------===//
+#ifndef LLVM_SUPPORT_OPTIONS_H
+#define LLVM_SUPPORT_OPTIONS_H
+
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/CommandLine.h"
/// The OptionRegistry is responsible for managing lifetimes of the options and
/// provides interfaces for option registration and reading values from options.
/// This object is a singleton, only one instance should ever exist so that all
-/// options are registered in teh same place.
+/// options are registered in the same place.
class OptionRegistry {
private:
DenseMap<void *, cl::Option *> Options;
/// \param Key unique key for option
/// \param O option to map to \p Key
///
- /// Allocated cl::Options are owened by the OptionRegistry and are deallocated
+ /// Allocated cl::Options are owned by the OptionRegistry and are deallocated
/// on destruction or removal
void addOption(void *Key, cl::Option *O);
/// \brief Registers an option with the OptionRegistry singleton.
///
- /// \param ValT type of the option's data
- /// \param Base class used to key the option
- /// \param Mem member of \p Base used for keying the option
+ /// \tparam ValT type of the option's data
+ /// \tparam Base class used to key the option
+ /// \tparam Mem member of \p Base used for keying the option
///
/// Options are keyed off the template parameters to generate unique static
/// characters. The template parameters are (1) the type of the data the
/// option stores (\p ValT), the class that will read the option (\p Base),
- /// and the memeber that the class will store the data into (\p Mem).
+ /// and the member that the class will store the data into (\p Mem).
template <typename ValT, typename Base, ValT(Base::*Mem)>
static void registerOption(const char *ArgStr, const char *Desc,
const ValT &InitValue) {
/// \brief Returns the value of the option.
///
- /// \param ValT type of the option's data
- /// \param Base class used to key the option
- /// \param Mem member of \p Base used for keying the option
+ /// \tparam ValT type of the option's data
+ /// \tparam Base class used to key the option
+ /// \tparam Mem member of \p Base used for keying the option
///
/// Reads option values based on the key generated by the template parameters.
/// Keying for get() is the same as keying for registerOption.
};
} // namespace llvm
+
+#endif