Do not require positional arguments when we're only printing out the graph.

llvm-svn: 50742
This commit is contained in:
Mikhail Glushenkov 2008-05-06 17:44:16 +00:00
parent 0620d0ca47
commit af932f0d96
1 changed files with 13 additions and 3 deletions

View File

@ -32,7 +32,7 @@ using namespace llvmcc;
// External linkage here is intentional.
cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input file>"),
cl::OneOrMore);
cl::ZeroOrMore);
cl::opt<std::string> OutputFilename("o", cl::desc("Output file name"),
cl::value_desc("file"));
cl::opt<bool> VerboseMode("v",
@ -70,10 +70,20 @@ int main(int argc, char** argv) {
"LLVM Compiler Driver(Work In Progress)");
PopulateCompilationGraph(graph);
if(WriteGraph)
if (WriteGraph) {
graph.writeGraph();
if(ViewGraph)
return 0;
}
if (ViewGraph) {
graph.viewGraph();
return 0;
}
if (InputFilenames.empty()) {
std::cerr << "No input files.\n";
return 1;
}
return BuildTargets(graph);
}