HEX
Server: Apache/2.4.18 (Ubuntu)
System: Linux ubuntu 7.0.5-x86_64-linode173 #1 SMP PREEMPT_DYNAMIC Fri May 8 10:12:05 EDT 2026 x86_64
User: root (0)
PHP: 7.2.28-1+ubuntu16.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //usr/include/llvm-3.8/llvm/Support/RegistryParser.h
//=== RegistryParser.h - Linker-supported plugin registries -----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Defines a command-line parser for a registry.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_REGISTRYPARSER_H
#define LLVM_SUPPORT_REGISTRYPARSER_H

#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Registry.h"

namespace llvm {

  /// A command-line parser for a registry. Use like such:
  ///
  ///   static cl::opt<Registry<Collector>::entry, false,
  ///                  RegistryParser<Collector> >
  ///   GCOpt("gc", cl::desc("Garbage collector to use."),
  ///               cl::value_desc());
  ///
  /// To make use of the value:
  ///
  ///   Collector *TheCollector = GCOpt->instantiate();
  ///
  template <typename T, typename U = RegistryTraits<T> >
  class RegistryParser :
  public cl::parser<const typename U::entry*>,
    public Registry<T, U>::listener {
    typedef U traits;
    typedef typename U::entry entry;
    typedef typename Registry<T, U>::listener listener;

  protected:
    void registered(const entry &E) {
      addLiteralOption(traits::nameof(E), &E, traits::descof(E));
    }

  public:
    void initialize(cl::Option &O) {
      listener::init();
      cl::parser<const typename U::entry*>::initialize(O);
    }
  };

}

#endif // LLVM_SUPPORT_REGISTRYPARSER_H