2004-09-02 00:55:40 +02:00
|
|
|
//===-- llvm/Support/PluginLoader.h - Plugin Loader for Tools ---*- C++ -*-===//
|
2005-04-21 22:48:15 +02:00
|
|
|
//
|
2004-07-11 03:03:57 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:48:15 +02:00
|
|
|
//
|
2004-07-11 03:03:57 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// A tool can #include this file to get a -load option that allows the user to
|
|
|
|
// load arbitrary shared objects into the tool's address space. Note that this
|
|
|
|
// header can only be included by a program ONCE, so it should never to used by
|
|
|
|
// library authors.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-02 00:55:40 +02:00
|
|
|
#ifndef LLVM_SUPPORT_PLUGINLOADER_H
|
|
|
|
#define LLVM_SUPPORT_PLUGINLOADER_H
|
2004-07-11 03:03:57 +02:00
|
|
|
|
2004-09-02 00:55:40 +02:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2004-07-11 03:03:57 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
struct PluginLoader {
|
|
|
|
void operator=(const std::string &Filename);
|
2006-01-26 19:36:50 +01:00
|
|
|
static unsigned getNumPlugins();
|
|
|
|
static std::string& getPlugin(unsigned num);
|
2004-07-11 03:03:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef DONT_GET_PLUGIN_LOADER_OPTION
|
|
|
|
// This causes operator= above to be invoked for every -load option.
|
|
|
|
static cl::opt<PluginLoader, false, cl::parser<std::string> >
|
|
|
|
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("pluginfilename"),
|
|
|
|
cl::desc("Load the specified plugin"));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|