diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 17:44:16 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 17:44:16 +0000 |
commit | d7bb87a5a3243d29b1d8d345f794fd1adcaeb8e0 (patch) | |
tree | 1714a08a3afe025f6a9abdcd474cd0fc770fc9e6 | |
parent | 4f6e3a497eab46d489bd1a6a095ef1a09956f0e4 (diff) |
Do not require positional arguments when we're only printing out the graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/llvmc2/llvmc.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/llvmc2/llvmc.cpp b/tools/llvmc2/llvmc.cpp index bb818c3170..b991202e43 100644 --- a/tools/llvmc2/llvmc.cpp +++ b/tools/llvmc2/llvmc.cpp @@ -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); } |