[llvm-commits] [llvm] r50742 - /llvm/trunk/tools/llvmc2/llvmc.cpp
Mikhail Glushenkov
foldr at codedgers.com
Tue May 6 10:44:17 PDT 2008
Author: foldr
Date: Tue May 6 12:44:16 2008
New Revision: 50742
URL: http://llvm.org/viewvc/llvm-project?rev=50742&view=rev
Log:
Do not require positional arguments when we're only printing out the graph.
Modified:
llvm/trunk/tools/llvmc2/llvmc.cpp
Modified: llvm/trunk/tools/llvmc2/llvmc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/llvmc.cpp?rev=50742&r1=50741&r2=50742&view=diff
==============================================================================
--- llvm/trunk/tools/llvmc2/llvmc.cpp (original)
+++ llvm/trunk/tools/llvmc2/llvmc.cpp Tue May 6 12:44:16 2008
@@ -32,7 +32,7 @@
// 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 @@
"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);
}
More information about the llvm-commits
mailing list