1193323Sed//===-- llvm/Support/PluginLoader.h - Plugin Loader for Tools ---*- C++ -*-===//
2193323Sed//
3193323Sed//                     The LLVM Compiler Infrastructure
4193323Sed//
5193323Sed// This file is distributed under the University of Illinois Open Source
6193323Sed// License. See LICENSE.TXT for details.
7193323Sed//
8193323Sed//===----------------------------------------------------------------------===//
9193323Sed//
10193323Sed// A tool can #include this file to get a -load option that allows the user to
11193323Sed// load arbitrary shared objects into the tool's address space.  Note that this
12193323Sed// header can only be included by a program ONCE, so it should never to used by
13193323Sed// library authors.
14193323Sed//
15193323Sed//===----------------------------------------------------------------------===//
16193323Sed
17193323Sed#ifndef LLVM_SUPPORT_PLUGINLOADER_H
18193323Sed#define LLVM_SUPPORT_PLUGINLOADER_H
19193323Sed
20193323Sed#include "llvm/Support/CommandLine.h"
21193323Sed
22193323Sednamespace llvm {
23193323Sed  struct PluginLoader {
24193323Sed    void operator=(const std::string &Filename);
25193323Sed    static unsigned getNumPlugins();
26193323Sed    static std::string& getPlugin(unsigned num);
27193323Sed  };
28193323Sed
29193323Sed#ifndef DONT_GET_PLUGIN_LOADER_OPTION
30193323Sed  // This causes operator= above to be invoked for every -load option.
31193323Sed  static cl::opt<PluginLoader, false, cl::parser<std::string> >
32193323Sed    LoadOpt("load", cl::ZeroOrMore, cl::value_desc("pluginfilename"),
33193323Sed            cl::desc("Load the specified plugin"));
34193323Sed#endif
35193323Sed}
36193323Sed
37193323Sed#endif
38