diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2005-05-19 00:52:28 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2005-05-19 00:52:28 +0000 |
commit | cc97cfc43eb481ef61763feecb16aa3658016284 (patch) | |
tree | b3a02020992025dba6145192325de7812367d527 /tools/llvmc/CompilerDriver.cpp | |
parent | 8f9e21e3deaf89253458d21fcdca1fc293b3efba (diff) | |
download | llvm-cc97cfc43eb481ef61763feecb16aa3658016284.tar.gz llvm-cc97cfc43eb481ef61763feecb16aa3658016284.tar.bz2 llvm-cc97cfc43eb481ef61763feecb16aa3658016284.tar.xz |
For PR514:
* language specification files are no longer configured with "configure"
* add substitutions for %bindir%, %libdir%, and various llvmgcc related
variables needed in the c and cpp spec files.
* Implement the stubstituions in the Compiler Driver.
* Move st.in to projects/Stacker/tools/stkrc where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/CompilerDriver.cpp')
-rw-r--r-- | tools/llvmc/CompilerDriver.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/tools/llvmc/CompilerDriver.cpp b/tools/llvmc/CompilerDriver.cpp index e7addf86e4..39a2989926 100644 --- a/tools/llvmc/CompilerDriver.cpp +++ b/tools/llvmc/CompilerDriver.cpp @@ -249,6 +249,14 @@ private: } else found = false; break; + case 'b': + if (*PI == "%bindir%") { + std::string tmp(*PI); + tmp.replace(0,8,LLVM_BINDIR); + action->args.push_back(tmp); + } else + found = false; + break; case 'd': if (*PI == "%defs%") { StringVector::iterator I = Defines.begin(); @@ -282,13 +290,35 @@ private: found = false; break; case 'l': - if (*PI == "%libs%") { + if ((*PI)[1] == 'l') { + std::string tmp(*PI); + if (*PI == "%llvmgccdir%") + tmp.replace(0,12,LLVMGCCDIR); + else if (*PI == "%llvmgccarch%") + tmp.replace(0,13,LLVMGCCARCH); + else if (*PI == "%llvmgcc%") + tmp.replace(0,9,LLVMGCC); + else if (*PI == "%llvmgxx%") + tmp.replace(0,9,LLVMGXX); + else if (*PI == "%llvmcc1%") + tmp.replace(0,9,LLVMCC1); + else if (*PI == "%llvmcc1plus%") + tmp.replace(0,9,LLVMCC1); + else + found = false; + if (found) + action->args.push_back(tmp); + } else if (*PI == "%libs%") { PathVector::iterator I = LibraryPaths.begin(); PathVector::iterator E = LibraryPaths.end(); while (I != E) { action->args.push_back( std::string("-L") + I->toString() ); ++I; } + } else if (*PI == "%libdir%") { + std::string tmp(*PI); + tmp.replace(0,8,LLVM_LIBDIR); + action->args.push_back(tmp); } else found = false; break; @@ -896,6 +926,8 @@ private: CompilerDriver::~CompilerDriver() { } +CompilerDriver::ConfigDataProvider::~ConfigDataProvider() {} + CompilerDriver* CompilerDriver::Get(ConfigDataProvider& CDP) { return new CompilerDriverImpl(CDP); |