summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvmc/Configuration.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-08-13 20:21:22 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-08-13 20:21:22 +0000
commitfdda7ace310dacab46721d7e1f232c19463f31ff (patch)
treee792730c54a5f0297b21fd196f20898845c2c416 /llvm/tools/llvmc/Configuration.h
parentc0f1b21c7b1855a336aa6510a74ad6288757cc1c (diff)
downloadbcm5719-llvm-fdda7ace310dacab46721d7e1f232c19463f31ff.tar.gz
bcm5719-llvm-fdda7ace310dacab46721d7e1f232c19463f31ff.zip
First version of a utility internal to llvmc that handles the parsing and
construction of configuration data for compiler front ends. llvm-svn: 15727
Diffstat (limited to 'llvm/tools/llvmc/Configuration.h')
-rw-r--r--llvm/tools/llvmc/Configuration.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/llvm/tools/llvmc/Configuration.h b/llvm/tools/llvmc/Configuration.h
new file mode 100644
index 00000000000..f11931d9995
--- /dev/null
+++ b/llvm/tools/llvmc/Configuration.h
@@ -0,0 +1,58 @@
+//===- ConfigData.h - Configuration Data Provider ---------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Reid Spencer and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the LLVMC_ConfigDataProvider class which implements the
+// generation of ConfigData objects for the CompilerDriver.
+//
+//===------------------------------------------------------------------------===
+#ifndef LLVM_TOOLS_LLVMC_CONFIGDATA_H
+#define LLVM_TOOLS_LLVMC_CONFIGDATA_H
+
+#include "CompilerDriver.h"
+#include <Support/hash_map>
+
+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).
+ ///
+ /// @see llvmc.cpp
+ /// @brief The interface to the LLVM Compiler Driver.
+ class LLVMC_ConfigDataProvider : public CompilerDriver::ConfigDataProvider {
+ /// @name Constructor
+ /// @{
+ public:
+ LLVMC_ConfigDataProvider();
+ virtual ~LLVMC_ConfigDataProvider();
+
+ /// @name Methods
+ /// @{
+ public:
+ /// @brief Provide the configuration data to the CompilerDriver.
+ virtual CompilerDriver::ConfigData*
+ ProvideConfigData(const std::string& filetype);
+
+ /// @brief Allow the configuration directory to be set
+ virtual void setConfigDir(const std::string& dirName) { configDir = dirName; }
+
+ /// @}
+ /// @name Data
+ /// @{
+ private:
+ /// @brief This type is used internally to hold the configuration data.
+ typedef hash_map<std::string,CompilerDriver::ConfigData*,
+ hash<std::string>,std::equal_to<std::string> > ConfigDataMap;
+ ConfigDataMap Configurations; ///< The cache of configurations
+ std::string configDir;
+ /// @}
+ };
+}
+
+#endif
OpenPOWER on IntegriCloud