aboutsummaryrefslogtreecommitdiff
path: root/tools/llvmc/Configuration.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-08-30 06:29:06 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-08-30 06:29:06 +0000
commitca01f9bc6fc72143ed95cea2535085f151a97d41 (patch)
tree10c2266dc8bc678e824633389f8ac2ab4c62f610 /tools/llvmc/Configuration.cpp
parent7c14fd152e27aab095d0fe8471903d90c693f36e (diff)
Implement the "setIncludePaths" and "setSymbolDefines" interface methods.
Revise token substitution to be a little faster. Clean up exception throwing, make sure its always a std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/Configuration.cpp')
-rw-r--r--tools/llvmc/Configuration.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/tools/llvmc/Configuration.cpp b/tools/llvmc/Configuration.cpp
index a8c6791545..c398e529d7 100644
--- a/tools/llvmc/Configuration.cpp
+++ b/tools/llvmc/Configuration.cpp
@@ -156,13 +156,16 @@ namespace {
bool parseSubstitution(CompilerDriver::StringVector& optList) {
switch (token) {
case ARGS_SUBST: optList.push_back("%args%"); break;
+ case DEFS_SUBST: optList.push_back("%defs%"); break;
+ case FORCE_SUBST: optList.push_back("%force%"); break;
case IN_SUBST: optList.push_back("%in%"); break;
- case OUT_SUBST: optList.push_back("%out%"); break;
- case TIME_SUBST: optList.push_back("%time%"); break;
- case STATS_SUBST: optList.push_back("%stats%"); break;
+ case INCLS_SUBST: optList.push_back("%incls%"); break;
+ case LIBS_SUBST: optList.push_back("%libs%"); break;
case OPT_SUBST: optList.push_back("%opt%"); break;
+ case OUT_SUBST: optList.push_back("%out%"); break;
case TARGET_SUBST: optList.push_back("%target%"); break;
- case FORCE_SUBST: optList.push_back("%force%"); break;
+ case STATS_SUBST: optList.push_back("%stats%"); break;
+ case TIME_SUBST: optList.push_back("%time%"); break;
case VERBOSE_SUBST: optList.push_back("%verbose%"); break;
default:
return false;
@@ -425,7 +428,8 @@ LLVMC_ConfigDataProvider::ReadConfigData(const std::string& ftype) {
confFile.set_directory(conf);
confFile.append_file(ftype);
if (!confFile.readable())
- throw "Configuration file for '" + ftype + "' is not available.";
+ throw std::string("Configuration file for '") + ftype +
+ "' is not available.";
} else {
// Try the user's home directory
confFile = sys::Path::GetUserHomeDirectory();
@@ -445,7 +449,8 @@ LLVMC_ConfigDataProvider::ReadConfigData(const std::string& ftype) {
confFile = sys::Path::GetLLVMDefaultConfigDir();
confFile.append_file(ftype);
if (!confFile.readable()) {
- throw "Configuration file for '" + ftype + "' is not available.";
+ throw std::string("Configuration file for '") + ftype +
+ "' is not available.";
}
}
}
@@ -454,11 +459,13 @@ LLVMC_ConfigDataProvider::ReadConfigData(const std::string& ftype) {
confFile = configDir;
confFile.append_file(ftype);
if (!confFile.readable())
- throw "Configuration file for '" + ftype + "' is not available.";
+ throw std::string("Configuration file for '") + ftype +
+ "' is not available.";
}
FileInputProvider fip( confFile.get() );
if (!fip.okay()) {
- throw "Configuration file for '" + ftype + "' is not available.";
+ throw std::string("Configuration file for '") + ftype +
+ "' is not available.";
}
result = new CompilerDriver::ConfigData();
ParseConfigData(fip,*result);