2004-08-20 05:17:53 +08:00
|
|
|
//===- Configuration.h - Configuration Data Mgmt ----------------*- C++ -*-===//
|
2005-04-22 08:00:37 +08:00
|
|
|
//
|
2004-08-14 04:21:22 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2005-04-22 08:00:37 +08:00
|
|
|
// This file was developed by Reid Spencer and is distributed under the
|
2004-08-14 04:21:22 +08:00
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-22 08:00:37 +08:00
|
|
|
//
|
2004-08-14 04:21:22 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the LLVMC_ConfigDataProvider class which implements the
|
|
|
|
// generation of ConfigData objects for the CompilerDriver.
|
|
|
|
//
|
2006-05-30 02:52:05 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-08-14 04:21:22 +08:00
|
|
|
#ifndef LLVM_TOOLS_LLVMC_CONFIGDATA_H
|
|
|
|
#define LLVM_TOOLS_LLVMC_CONFIGDATA_H
|
|
|
|
|
|
|
|
#include "CompilerDriver.h"
|
2004-09-02 06:55:40 +08:00
|
|
|
#include <llvm/ADT/hash_map>
|
2004-08-14 04:21:22 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
/// This class provides the high level interface to the LLVM Compiler Driver.
|
|
|
|
/// The driver's purpose is to make it easier for compiler writers and users
|
|
|
|
/// of LLVM to utilize the compiler toolkits and LLVM toolset by learning only
|
|
|
|
/// the interface of one program (llvmc).
|
2005-04-22 08:00:37 +08:00
|
|
|
///
|
2004-08-14 04:21:22 +08:00
|
|
|
/// @see llvmc.cpp
|
|
|
|
/// @brief The interface to the LLVM Compiler Driver.
|
|
|
|
class LLVMC_ConfigDataProvider : public CompilerDriver::ConfigDataProvider {
|
|
|
|
/// @name Constructor
|
|
|
|
/// @{
|
|
|
|
public:
|
|
|
|
virtual ~LLVMC_ConfigDataProvider();
|
|
|
|
|
|
|
|
/// @name Methods
|
|
|
|
/// @{
|
|
|
|
public:
|
|
|
|
/// @brief Provide the configuration data to the CompilerDriver.
|
2005-04-22 08:00:37 +08:00
|
|
|
virtual CompilerDriver::ConfigData*
|
2004-08-14 04:21:22 +08:00
|
|
|
ProvideConfigData(const std::string& filetype);
|
|
|
|
|
|
|
|
/// @brief Allow the configuration directory to be set
|
2005-04-22 08:00:37 +08:00
|
|
|
virtual void setConfigDir(const sys::Path& dirName) {
|
|
|
|
configDir = dirName;
|
2004-08-30 03:26:56 +08:00
|
|
|
}
|
2004-08-14 04:21:22 +08:00
|
|
|
|
2004-08-14 17:37:15 +08:00
|
|
|
private:
|
|
|
|
CompilerDriver::ConfigData* ReadConfigData(const std::string& ftype);
|
|
|
|
|
2004-08-14 04:21:22 +08:00
|
|
|
/// @}
|
|
|
|
/// @name Data
|
|
|
|
/// @{
|
|
|
|
private:
|
|
|
|
/// @brief This type is used internally to hold the configuration data.
|
2004-10-26 03:09:41 +08:00
|
|
|
typedef hash_map<std::string,CompilerDriver::ConfigData*> ConfigDataMap;
|
2004-08-14 04:21:22 +08:00
|
|
|
ConfigDataMap Configurations; ///< The cache of configurations
|
2004-08-30 03:26:56 +08:00
|
|
|
sys::Path configDir;
|
2004-08-14 04:21:22 +08:00
|
|
|
/// @}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|