1 //===- Configuration.h - Configuration Data Mgmt ----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Reid Spencer and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the LLVMC_ConfigDataProvider class which implements the
11 // generation of ConfigData objects for the CompilerDriver.
13 //===------------------------------------------------------------------------===
14 #ifndef LLVM_TOOLS_LLVMC_CONFIGDATA_H
15 #define LLVM_TOOLS_LLVMC_CONFIGDATA_H
17 #include "CompilerDriver.h"
18 #include <llvm/ADT/hash_map>
21 /// This class provides the high level interface to the LLVM Compiler Driver.
22 /// The driver's purpose is to make it easier for compiler writers and users
23 /// of LLVM to utilize the compiler toolkits and LLVM toolset by learning only
24 /// the interface of one program (llvmc).
27 /// @brief The interface to the LLVM Compiler Driver.
28 class LLVMC_ConfigDataProvider : public CompilerDriver::ConfigDataProvider {
32 virtual ~LLVMC_ConfigDataProvider();
37 /// @brief Provide the configuration data to the CompilerDriver.
38 virtual CompilerDriver::ConfigData*
39 ProvideConfigData(const std::string& filetype);
41 /// @brief Allow the configuration directory to be set
42 virtual void setConfigDir(const sys::Path& dirName) {
47 CompilerDriver::ConfigData* ReadConfigData(const std::string& ftype);
53 /// @brief This type is used internally to hold the configuration data.
54 typedef hash_map<std::string,CompilerDriver::ConfigData*> ConfigDataMap;
55 ConfigDataMap Configurations; ///< The cache of configurations