mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Registry.h should not depend on CommandLine.h.
Split Support/Registry.h into two files so that we have less to recompile every time CommandLine.h is changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62312 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
#ifndef LLVM_SUPPORT_REGISTRY_H
|
||||
#define LLVM_SUPPORT_REGISTRY_H
|
||||
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
namespace llvm {
|
||||
/// A simple registry entry which provides only a name, description, and
|
||||
/// no-argument constructor.
|
||||
@@ -204,33 +202,7 @@ namespace llvm {
|
||||
: Entry(Name, Desc, CtorFn), Node(Entry) {}
|
||||
};
|
||||
|
||||
|
||||
/// A command-line parser for a registry. Use like such:
|
||||
///
|
||||
/// static cl::opt<Registry<Collector>::entry, false,
|
||||
/// Registry<Collector>::Parser>
|
||||
/// GCOpt("gc", cl::desc("Garbage collector to use."),
|
||||
/// cl::value_desc());
|
||||
///
|
||||
/// To make use of the value:
|
||||
///
|
||||
/// Collector *TheCollector = GCOpt->instantiate();
|
||||
///
|
||||
class Parser : public cl::parser<const typename U::entry*>, public listener{
|
||||
typedef U traits;
|
||||
typedef typename U::entry entry;
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
/// Registry::Parser now lives in llvm/Support/RegistryParser.h.
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user