aboutsummaryrefslogtreecommitdiff
path: root/tools/llvmc/llvmc.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-08-15 08:19:46 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-08-15 08:19:46 +0000
commitbf437720381ded52024e52560bc84e95dde266f7 (patch)
tree35a2b230242d321dfa77bbc6392e6075948ed2fb /tools/llvmc/llvmc.cpp
parent936f5c72e20a19f7c7814c427db44d03eed1c60f (diff)
More Functionality:
- cleaned up lexical scanner - added support for "lang.optN" configuration items - added temporary file support (ala lib/System) - corrected logic for deciding which phases to run - consolidated the Action and ActionPattern classes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/llvmc.cpp')
-rw-r--r--tools/llvmc/llvmc.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/tools/llvmc/llvmc.cpp b/tools/llvmc/llvmc.cpp
index 9cf43cb3ff..1640803cd4 100644
--- a/tools/llvmc/llvmc.cpp
+++ b/tools/llvmc/llvmc.cpp
@@ -69,19 +69,23 @@ static cl::opt<CompilerDriver::OptimizationLevels> OptLevel(
//=== TOOL OPTIONS
//===------------------------------------------------------------------------===
-static cl::opt<std::string> PPToolOpts("Tpp", cl::ZeroOrMore,
+static cl::list<std::string> PreprocessorToolOpts("Tpre", cl::ZeroOrMore,
cl::desc("Pass specific options to the pre-processor"),
cl::value_desc("option"));
-static cl::opt<std::string> AsmToolOpts("Tasm", cl::ZeroOrMore,
+static cl::list<std::string> TranslatorToolOpts("Ttrn", cl::ZeroOrMore,
cl::desc("Pass specific options to the assembler"),
cl::value_desc("option"));
-static cl::opt<std::string> OptToolOpts("Topt", cl::ZeroOrMore,
+static cl::list<std::string> AssemblerToolOpts("Tasm", cl::ZeroOrMore,
+ cl::desc("Pass specific options to the assembler"),
+ cl::value_desc("option"));
+
+static cl::list<std::string> OptimizerToolOpts("Topt", cl::ZeroOrMore,
cl::desc("Pass specific options to the optimizer"),
cl::value_desc("option"));
-static cl::opt<std::string> LinkToolOpts("Tlink", cl::ZeroOrMore,
+static cl::list<std::string> LinkerToolOpts("Tlnk", cl::ZeroOrMore,
cl::desc("Pass specific options to the linker"),
cl::value_desc("option"));
@@ -142,9 +146,12 @@ static cl::opt<std::string> ConfigDir("config-dir", cl::Optional,
cl::desc("Specify a configuration directory to override defaults"),
cl::value_desc("directory"));
-static cl::opt<bool> EmitRawCode("emit-raw-code", cl::Hidden,
+static cl::opt<bool> EmitRawCode("emit-raw-code", cl::Hidden, cl::Optional,
cl::desc("Emit raw, unoptimized code"));
+static cl::opt<bool> PipeCommands("pipe", cl::Optional,
+ cl::desc("Invoke sub-commands by linking input/output with pipes"));
+
//===------------------------------------------------------------------------===
//=== POSITIONAL OPTIONS
//===------------------------------------------------------------------------===
@@ -200,6 +207,8 @@ int main(int argc, char **argv) {
std::cerr << argv[0] << ": Not implemented yet: -native";
if (EmitRawCode)
std::cerr << argv[0] << ": Not implemented yet: -emit-raw-code";
+ if (PipeCommands)
+ std::cerr << argv[0] << ": Not implemented yet: -pipe";
// Default the output file, only if we're going to try to link
if (OutputFilename.empty() && OptLevel == CompilerDriver::LINKING)
@@ -221,10 +230,12 @@ int main(int argc, char **argv) {
CD.setOutputMachine(OutputMachine);
CD.setEmitNativeCode(Native);
CD.setEmitRawCode(EmitRawCode);
- std::vector<std::string>::iterator pathIt = LibPaths.begin();
- while ( pathIt != LibPaths.end() ) {
- CD.addLibraryPath( *pathIt++ );
- }
+ CD.setLibraryPaths(LibPaths);
+ CD.setPreprocessorOptions(PreprocessorToolOpts);
+ CD.setTranslatorOptions(TranslatorToolOpts);
+ CD.setOptimizerOptions(OptimizerToolOpts);
+ CD.setAssemblerOptions(AssemblerToolOpts);
+ CD.setLinkerOptions(LinkerToolOpts);
// Prepare the list of files to be compiled by the CompilerDriver.
CompilerDriver::InputList InpList;